aboutsummaryrefslogtreecommitdiff
path: root/Timeline/ClientApp/src/app/user/internal-user-service/errors.ts
diff options
context:
space:
mode:
author杨宇千 <crupest@outlook.com>2019-03-11 19:52:29 +0800
committerGitHub <noreply@github.com>2019-03-11 19:52:29 +0800
commit6f02dc7094d1304501e7ffd6c39ecf89369202c7 (patch)
treed031e2d14933574de04c892accb59560bdbea395 /Timeline/ClientApp/src/app/user/internal-user-service/errors.ts
parent028af6f786ac2664d301614d57bbff053c3dc9c0 (diff)
parent5d1d884635713278a792f99bb32cbe6d7471b0df (diff)
downloadtimeline-6f02dc7094d1304501e7ffd6c39ecf89369202c7.tar.gz
timeline-6f02dc7094d1304501e7ffd6c39ecf89369202c7.tar.bz2
timeline-6f02dc7094d1304501e7ffd6c39ecf89369202c7.zip
Merge pull request #11 from crupest/7-user-route
Use named route in user dialog.
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.ts25
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!');
+ }
+}