Skip to content

Commit

Permalink
update check error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
SandroMaglione committed Dec 4, 2022
1 parent 9e673a5 commit 7e167a2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
13 changes: 6 additions & 7 deletions lib/app/failures/get_user_information_failure.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ abstract class GetUserInformationFailure {
const GetUserInformationFailure();

String get mapToErrorMessage {
switch (runtimeType) {
case RequestGetUserInformationFailure:
return 'Error when getting user information';
case ResponseFormatErrorGetUserInformationFailure:
return 'Invalid response';
case JsonDecodeGetUserInformationFailure:
return 'Missing valid user information';
if (this is RequestGetUserInformationFailure) {
return 'Error when getting user information';
} else if (this is ResponseFormatErrorGetUserInformationFailure) {
return 'Invalid response';
} else if (this is JsonDecodeGetUserInformationFailure) {
return 'Missing valid user information';
}

return 'Unexpected error, please try again';
Expand Down
5 changes: 2 additions & 3 deletions lib/app/failures/sign_out_failure.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ abstract class SignOutFailure {
const SignOutFailure();

String get mapToErrorMessage {
switch (runtimeType) {
case ExecutionErrorSignOutFailure:
return 'Error when making sign out request';
if (this is ExecutionErrorSignOutFailure) {
return 'Error when making sign out request';
}

return 'Unexpected error, please try again';
Expand Down
5 changes: 2 additions & 3 deletions lib/app/failures/update_user_information_failure.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ abstract class UpdateUserInformationFailure {
const UpdateUserInformationFailure();

String get mapToErrorMessage {
switch (runtimeType) {
case RequestUpdateUserInformationFailure:
return 'Error when updating user information';
if (this is RequestUpdateUserInformationFailure) {
return 'Error when updating user information';
}

return 'Unexpected error, please try again';
Expand Down

0 comments on commit 7e167a2

Please sign in to comment.