-
Notifications
You must be signed in to change notification settings - Fork 18
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 #22 from kbariotis/add-error-stacking
Add error stacking
- Loading branch information
Showing
24 changed files
with
146 additions
and
65 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,7 +1,11 @@ | ||
import ExtendableError from "../CustomError"; | ||
|
||
export default class BadGateway extends ExtendableError { | ||
constructor(message: string = "Bad Gateway", errorCode: number = 502) { | ||
super(message, 502, errorCode); | ||
constructor( | ||
message: string = "Bad Gateway", | ||
errorCode: number = 502, | ||
originalError?: Error | ||
) { | ||
super(message, 502, errorCode, originalError); | ||
} | ||
} |
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,11 @@ | ||
import ExtendableError from "../CustomError"; | ||
|
||
export default class BadRequest extends ExtendableError { | ||
constructor(message: string = "Bad Request", errorCode: number = 400) { | ||
super(message, 400, errorCode); | ||
constructor( | ||
message: string = "Bad Request", | ||
errorCode: number = 400, | ||
originalError?: Error | ||
) { | ||
super(message, 400, errorCode, originalError); | ||
} | ||
} |
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,11 @@ | ||
import ExtendableError from "../CustomError"; | ||
|
||
export default class Conflict extends ExtendableError { | ||
constructor(message: string = "Conflict", errorCode: number = 409) { | ||
super(message, 409, errorCode); | ||
constructor( | ||
message: string = "Conflict", | ||
errorCode: number = 409, | ||
originalError?: Error | ||
) { | ||
super(message, 409, errorCode, originalError); | ||
} | ||
} |
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,11 @@ | ||
import ExtendableError from "../CustomError"; | ||
|
||
export default class FailedDependency extends ExtendableError { | ||
constructor(message: string = "Failed Dependency", errorCode: number = 424) { | ||
super(message, 424, errorCode); | ||
constructor( | ||
message: string = "Failed Dependency", | ||
errorCode: number = 424, | ||
originalError?: Error | ||
) { | ||
super(message, 424, errorCode, originalError); | ||
} | ||
} |
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,11 @@ | ||
import ExtendableError from "../CustomError"; | ||
|
||
export default class Forbidden extends ExtendableError { | ||
constructor(message: string = "Forbiden", errorCode: number = 403) { | ||
super(message, 403, errorCode); | ||
constructor( | ||
message: string = "Forbiden", | ||
errorCode: number = 403, | ||
originalError?: Error | ||
) { | ||
super(message, 403, errorCode, originalError); | ||
} | ||
} |
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,11 @@ | ||
import ExtendableError from "../CustomError"; | ||
|
||
export default class GatewayTimeout extends ExtendableError { | ||
constructor(message: string = "Gateway Timeout", errorCode: number = 504) { | ||
super(message, 504, errorCode); | ||
constructor( | ||
message: string = "Gateway Timeout", | ||
errorCode: number = 504, | ||
originalError?: Error | ||
) { | ||
super(message, 504, errorCode, originalError); | ||
} | ||
} |
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,11 @@ | ||
import ExtendableError from "../CustomError"; | ||
|
||
export default class Gone extends ExtendableError { | ||
constructor(message: string = "Gone", errorCode: number = 410) { | ||
super(message, 410, errorCode); | ||
constructor( | ||
message: string = "Gone", | ||
errorCode: number = 410, | ||
originalError?: Error | ||
) { | ||
super(message, 410, errorCode, originalError); | ||
} | ||
} |
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,7 +1,11 @@ | ||
import ExtendableError from "../CustomError"; | ||
|
||
export default class MethodNotAllowed extends ExtendableError { | ||
constructor(message: string = "Method Not Allowed", errorCode: number = 405) { | ||
super(message, 405, errorCode); | ||
constructor( | ||
message: string = "Method Not Allowed", | ||
errorCode: number = 405, | ||
originalError?: Error | ||
) { | ||
super(message, 405, errorCode, originalError); | ||
} | ||
} |
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,7 +1,11 @@ | ||
import ExtendableError from "../CustomError"; | ||
|
||
export default class NotAcceptable extends ExtendableError { | ||
constructor(message: string = "Not Acceptable", errorCode: number = 406) { | ||
super(message, 406, errorCode); | ||
constructor( | ||
message: string = "Not Acceptable", | ||
errorCode: number = 406, | ||
originalError?: Error | ||
) { | ||
super(message, 406, errorCode, originalError); | ||
} | ||
} |
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,11 @@ | ||
import ExtendableError from "../CustomError"; | ||
|
||
export default class NotFound extends ExtendableError { | ||
constructor(message: string = "Not Found", errorCode: number = 404) { | ||
super(message, 404, errorCode); | ||
constructor( | ||
message: string = "Not Found", | ||
errorCode: number = 404, | ||
originalError?: Error | ||
) { | ||
super(message, 404, errorCode, originalError); | ||
} | ||
} |
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,11 @@ | ||
import ExtendableError from "../CustomError"; | ||
|
||
export default class NotImplemented extends ExtendableError { | ||
constructor(message: string = "Not Implemented", errorCode: number = 501) { | ||
super(message, 501, errorCode); | ||
constructor( | ||
message: string = "Not Implemented", | ||
errorCode: number = 501, | ||
originalError?: Error | ||
) { | ||
super(message, 501, errorCode, originalError); | ||
} | ||
} |
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,11 @@ | ||
import ExtendableError from "../CustomError"; | ||
|
||
export default class PaymentRequired extends ExtendableError { | ||
constructor(message: string = "Payment Required", errorCode: number = 402) { | ||
super(message, 402, errorCode); | ||
constructor( | ||
message: string = "Payment Required", | ||
errorCode: number = 402, | ||
originalError?: Error | ||
) { | ||
super(message, 402, errorCode, originalError); | ||
} | ||
} |
Oops, something went wrong.