-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 1279 issues left.
- Loading branch information
Showing
43 changed files
with
481 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
lib/features/authentication/repository/exceptions/exceptions.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,53 @@ | ||
/// Basic exception class of login | ||
sealed class LoginException implements Exception {} | ||
|
||
/// The form hash used in login progress is not found. | ||
final class LoginFormHashNotFoundException implements LoginException {} | ||
|
||
/// Found form hash, but it's not in the expect format. | ||
final class LoginInvalidFormHashException implements LoginException {} | ||
|
||
/// The login result message of login progress is not found. | ||
/// | ||
/// Indicating that we do not know whether we logged in successful or not. | ||
final class LoginMessageNotFoundException implements LoginException {} | ||
|
||
/// The captcha user texted is incorrect. | ||
final class LoginIncorrectCaptchaException implements LoginException {} | ||
|
||
/// Incorrect password or account. | ||
final class LoginInvalidCredentialException implements LoginException {} | ||
|
||
/// Security question or its answer is incorrect. | ||
final class LoginIncorrectSecurityQuestionException implements LoginException {} | ||
|
||
/// Reached the limit of login attempt. | ||
/// | ||
/// Maybe locked in 20 minutes. | ||
final class LoginAttemptLimitException implements LoginException {} | ||
|
||
/// User info not found when try to login after login seems success. | ||
/// | ||
/// Now we should update the logged user info but this exception means we can | ||
/// not found the logged user info. | ||
final class LoginUserInfoNotFoundException implements LoginException {} | ||
|
||
/// Some other exception that not recognized. | ||
final class LoginOtherErrorException implements LoginException { | ||
/// Constructor. | ||
LoginOtherErrorException(this.message); | ||
|
||
/// Message to describe the error. | ||
final String message; | ||
} | ||
|
||
/// Basic exception class of logout. | ||
sealed class LogoutException implements Exception {} | ||
|
||
/// The form hash used to logout is not found. | ||
final class LogoutFormHashNotFoundException implements LogoutException {} | ||
|
||
/// Failed to logout. | ||
/// | ||
/// Nearly impossible to happen. | ||
final class LogoutFailedException implements LogoutException {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
lib/features/authentication/repository/internal/user_info.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.