This repository has been archived by the owner on May 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update(🚚): nullable type + refactor exceptions
- Loading branch information
1 parent
38aa6df
commit 7c07a84
Showing
4 changed files
with
24 additions
and
15 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
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,8 +1,8 @@ | ||
import BaseException from "./BaseException" | ||
|
||
export default class HttpException extends BaseException { | ||
constructor(status: number | string, message: string, url: string, originalError: object) { | ||
super(status, message, url, originalError); | ||
constructor(status: Nullable<number | string> = 'unknown', message: Nullable<string> = 'unknown', url: Nullable<string> = 'unknown', originalError: Nullable<object>) { | ||
super(status, message, url, originalError) | ||
this._type = 'HttpException' | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import BaseException from "./BaseException" | ||
|
||
export default class HttpTimeoutException extends BaseException { | ||
constructor(status: Nullable<number | string> = 'unknown', message: Nullable<string> = 'unknown', url: Nullable<string> = 'unknown', originalError: Nullable<object>) { | ||
super(status, message, url, originalError) | ||
this._type = 'HttpTimeoutException' | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
declare type Nullable<T> = T | null | undefined |