-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactoring docs and class implementations
- Loading branch information
Showing
7 changed files
with
69 additions
and
39 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,35 @@ | ||
export class InvalidAPIKeyFormat extends Error { | ||
constructor(message: string = "Invalid API key format") { | ||
static DEFAULT_MESSAGE = "Invalid API key format"; | ||
|
||
constructor(message: string = InvalidAPIKeyFormat.DEFAULT_MESSAGE) { | ||
super(message); | ||
this.name = "InvalidAPIKeyFormat"; | ||
if (Error.captureStackTrace) { | ||
Error.captureStackTrace(this, InvalidAPIKeyFormat); | ||
} | ||
} | ||
} | ||
|
||
export class InternalError extends Error { | ||
constructor(message: string = "Internal Error") { | ||
static DEFAULT_MESSAGE = "Internal Error"; | ||
|
||
constructor(message: string = InternalError.DEFAULT_MESSAGE) { | ||
super(message); | ||
this.name = "InternalError"; | ||
if (Error.captureStackTrace) { | ||
Error.captureStackTrace(this, InternalError); | ||
} | ||
} | ||
} | ||
|
||
export class InvalidConfiguration extends Error { | ||
constructor(message: string = "Invalid configuration") { | ||
static DEFAULT_MESSAGE = "Invalid configuration"; | ||
|
||
constructor(message: string = InvalidConfiguration.DEFAULT_MESSAGE) { | ||
super(message); | ||
this.name = "InvalidConfiguration"; | ||
if (Error.captureStackTrace) { | ||
Error.captureStackTrace(this, InvalidConfiguration); | ||
} | ||
} | ||
} |
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