Skip to content

Commit 67f69cd

Browse files
committed
Roll back previous attempts to support typescript superclassing of Errors
1 parent aa2ed45 commit 67f69cd

File tree

5 files changed

+2
-14
lines changed

5 files changed

+2
-14
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "strontium",
3-
"version": "2.3.2",
3+
"version": "2.3.3",
44
"description": "Strontium is a TypeScript toolkit for High Performance API servers built for Production not Projects.",
55
"main": "lib/src/index.js",
66
"types": "lib/src/index.d.ts",

src/errors/TransientError.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
11
import { StrontiumError } from "./StrontiumError"
22

3-
export class TransientError extends StrontiumError {
4-
constructor(message?: string) {
5-
super(message)
6-
7-
Object.setPrototypeOf(this, TransientError.prototype)
8-
}
9-
}
3+
export class TransientError extends StrontiumError {}

src/errors/http/HTTPError.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ export abstract class HTTPError extends StrontiumError {
77
public internalMessage?: string
88
) {
99
super(internalMessage)
10-
11-
Object.setPrototypeOf(this, HTTPError.prototype)
1210
}
1311

1412
toResponseBody(): { statusCode: number; errorMessage: string } {

src/errors/http/InternalServerError.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,5 @@ export class InternalServerError extends HTTPError {
77
"An internal error occurred. The system administrator has been notified.",
88
"Internal Error occurred."
99
)
10-
11-
Object.setPrototypeOf(this, InternalServerError.prototype)
1210
}
1311
}

src/errors/http/ValidationError.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ export class ValidationError extends HTTPError {
88
public fieldPath?: string
99
) {
1010
super(400, externalMessage, internalMessage)
11-
12-
Object.setPrototypeOf(this, ValidationError.prototype)
1311
}
1412

1513
public toResponseBody(): {

0 commit comments

Comments
 (0)