-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3fb58f2
commit 9acfbca
Showing
9 changed files
with
22 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { BaseException } from './base'; | ||
|
||
export class BadRequestException extends BaseException { | ||
public constructor(messages?: unknown, code?: string) { | ||
public constructor(messages?: unknown, code = 'BadRequestException') { | ||
super(400, messages, code); | ||
} | ||
} |
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,7 +1,7 @@ | ||
import { BaseException } from './base'; | ||
|
||
export class UnauthorizedException extends BaseException { | ||
public constructor(messages?: unknown, code?: string) { | ||
public constructor(messages: unknown, code = 'UnauthorizedException') { | ||
super(401, messages, code); | ||
} | ||
} |
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,7 +1,13 @@ | ||
import { BaseException } from './base'; | ||
|
||
export class ForbiddenException extends BaseException { | ||
public constructor(messages?: unknown, code?: string) { | ||
public constructor(messages: unknown, code = 'ForbiddenException') { | ||
super(403, messages, code); | ||
} | ||
} | ||
|
||
export class NeedVipException extends BaseException { | ||
public constructor(messages: unknown, code = 'NeedVip') { | ||
super(403, messages, code); | ||
} | ||
} |
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,7 +1,7 @@ | ||
import { BaseException } from './base'; | ||
|
||
export class NotFoundException extends BaseException { | ||
public constructor(messages?: unknown, code?: string) { | ||
public constructor(messages: unknown, code = 'NotFoundException') { | ||
super(404, messages, code); | ||
} | ||
} |
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,7 +1,7 @@ | ||
import { BaseException } from './base'; | ||
|
||
export class ClientErrorException extends BaseException { | ||
public constructor(message: string, code?: string) { | ||
public constructor(message: string, code = 'ClientErrorException') { | ||
super(400, message, code); | ||
} | ||
} |
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,7 +1,7 @@ | ||
import { BaseException } from './base'; | ||
|
||
export class InternalErrorException extends BaseException { | ||
public constructor(message: string, code?: string) { | ||
public constructor(message: string, code = 'InternalErrorException') { | ||
super(500, message, code); | ||
} | ||
} |
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,7 +1,7 @@ | ||
import { BaseException } from './base'; | ||
|
||
export class ServerErrorException extends BaseException { | ||
public constructor(message: string, code?: string) { | ||
public constructor(message: string, code = 'ServerErrorException') { | ||
super(500, message, code); | ||
} | ||
} |
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