-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1999 from kwonoj/error-timeout
refactor(TimeoutError): timeout throws typed TimeoutError
- Loading branch information
Showing
4 changed files
with
23 additions
and
6 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
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/** | ||
* An error thrown when duetime elapses. | ||
* | ||
* @see {@link timeout} | ||
* | ||
* @class TimeoutError | ||
*/ | ||
export class TimeoutError extends Error { | ||
constructor() { | ||
const err: any = super('Timeout has occurred'); | ||
(<any> this).name = err.name = 'TimeoutError'; | ||
(<any> this).stack = err.stack; | ||
(<any> this).message = err.message; | ||
} | ||
} |