toMessage method

  1. @override
String toMessage()
override

Implementation

@override
String toMessage() {
  switch (code) {
    case UpdateUserAvatarErrorCode.invalidCropCoordinates:
      return 'err_invalid_crop_coordinates'.l10n;
    case UpdateUserAvatarErrorCode.invalidCropPoints:
      return 'err_invalid_crop_points'.l10n;
    case UpdateUserAvatarErrorCode.malformed:
      return 'err_uploaded_file_malformed'.l10n;
    case UpdateUserAvatarErrorCode.unsupportedFormat:
      return 'err_unsupported_format'.l10n;
    case UpdateUserAvatarErrorCode.invalidSize:
      return 'err_size_too_big'.l10n;
    case UpdateUserAvatarErrorCode.invalidDimensions:
      return 'err_dimensions_too_big'.l10n;
    case UpdateUserAvatarErrorCode.artemisUnknown:
      return 'err_unknown'.l10n;
  }
}