aboutsummaryrefslogtreecommitdiff
path: root/Timeline/ClientApp/src/app/user/internal-user-service/errors.ts
diff options
context:
space:
mode:
author杨宇千 <crupest@outlook.com>2019-04-11 21:13:15 +0800
committerGitHub <noreply@github.com>2019-04-11 21:13:15 +0800
commit8c5e7069d2651fb6fae641dfe482d7a0910b3fd1 (patch)
tree49dc35791778a4ed1403319708046ac8823210b6 /Timeline/ClientApp/src/app/user/internal-user-service/errors.ts
parent1eb6d9abfc24eec380b7b5d7423102a53041239e (diff)
parentf562660f52ce055e243b937a988f04c90ad3ae55 (diff)
downloadtimeline-8c5e7069d2651fb6fae641dfe482d7a0910b3fd1.tar.gz
timeline-8c5e7069d2651fb6fae641dfe482d7a0910b3fd1.tar.bz2
timeline-8c5e7069d2651fb6fae641dfe482d7a0910b3fd1.zip
Merge pull request #19 from crupest/18-createtoken
Change create token api.
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.ts16
1 files changed, 10 insertions, 6 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
index 22e44dd6..3358a9d9 100644
--- a/Timeline/ClientApp/src/app/user/internal-user-service/errors.ts
+++ b/Timeline/ClientApp/src/app/user/internal-user-service/errors.ts
@@ -1,25 +1,29 @@
-export abstract class LoginError extends Error { }
-
-export class BadNetworkError extends LoginError {
+export class BadNetworkError extends Error {
constructor() {
super('Network is bad.');
}
}
-export class AlreadyLoginError extends LoginError {
+export class AlreadyLoginError extends Error {
constructor() {
super('Internal logical error. There is already a token saved. Please call validateUserLoginState first.');
}
}
-export class BadCredentialsError extends LoginError {
+export class BadCredentialsError extends Error {
constructor() {
super('Username or password is wrong.');
}
}
-export class UnknownError extends LoginError {
+export class UnknownError extends Error {
constructor(public internalError?: any) {
super('Sorry, unknown error occured!');
}
}
+
+export class ServerInternalError extends Error {
+ constructor(message?: string) {
+ super('Wrong server response. ' + message);
+ }
+}