diff options
author | crupest <crupest@outlook.com> | 2019-03-09 21:36:55 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2019-03-09 21:36:55 +0800 |
commit | 14a799cc17f16ab93ee652bd9a2973c60cb3697c (patch) | |
tree | 9c34cb2354dd7fb90994c3659ae592f6b616c898 /Timeline/ClientApp/src/app/user/internal-user-service/errors.ts | |
parent | f65ac5d592e4e449dd513ad01cfd2b980324f240 (diff) | |
download | timeline-14a799cc17f16ab93ee652bd9a2973c60cb3697c.tar.gz timeline-14a799cc17f16ab93ee652bd9a2973c60cb3697c.tar.bz2 timeline-14a799cc17f16ab93ee652bd9a2973c60cb3697c.zip |
Seperate internal and public user service.
Diffstat (limited to 'Timeline/ClientApp/src/app/user/internal-user-service/errors.ts')
-rw-r--r-- | Timeline/ClientApp/src/app/user/internal-user-service/errors.ts | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Timeline/ClientApp/src/app/user/internal-user-service/errors.ts b/Timeline/ClientApp/src/app/user/internal-user-service/errors.ts new file mode 100644 index 00000000..22e44dd6 --- /dev/null +++ b/Timeline/ClientApp/src/app/user/internal-user-service/errors.ts @@ -0,0 +1,25 @@ +export abstract class LoginError extends Error { } + +export class BadNetworkError extends LoginError { + constructor() { + super('Network is bad.'); + } +} + +export class AlreadyLoginError extends LoginError { + constructor() { + super('Internal logical error. There is already a token saved. Please call validateUserLoginState first.'); + } +} + +export class BadCredentialsError extends LoginError { + constructor() { + super('Username or password is wrong.'); + } +} + +export class UnknownError extends LoginError { + constructor(public internalError?: any) { + super('Sorry, unknown error occured!'); + } +} |