-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add timeout value and status code to TimeoutError
- Loading branch information
Dustin Callaway
committed
Jun 10, 2019
1 parent
e7dbadf
commit 877e07d
Showing
3 changed files
with
19 additions
and
12 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 +1,10 @@ | ||
export default class TimeoutError extends Error {} | ||
export default class TimeoutError extends Error { | ||
public timeout: number; | ||
public statusCode: number; | ||
|
||
constructor(message: string, timeout?: number, statusCode?: number) { | ||
super(message); | ||
this.timeout = timeout; | ||
this.statusCode = statusCode || 408; | ||
} | ||
} |
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