aboutsummaryrefslogtreecommitdiff
path: root/Timeline/ClientApp/src/app/user/internal-user-service/errors.ts
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2019-03-09 21:36:55 +0800
committercrupest <crupest@outlook.com>2019-03-09 21:36:55 +0800
commit76300141a6411c05d585994d5f19938bfe45838e (patch)
tree90c90c6dafebab55435f032af7aff065d68c8f39 /Timeline/ClientApp/src/app/user/internal-user-service/errors.ts
parentb01ba534a0017ad8bf85ddecff7610a6de6a74e9 (diff)
downloadtimeline-76300141a6411c05d585994d5f19938bfe45838e.tar.gz
timeline-76300141a6411c05d585994d5f19938bfe45838e.tar.bz2
timeline-76300141a6411c05d585994d5f19938bfe45838e.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.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!');
+ }
+}