Code cleanup
This commit is contained in:
@@ -25,7 +25,13 @@ export class PrintfulError extends Error {
|
||||
public status: number = 502
|
||||
) {
|
||||
super(message);
|
||||
this.name = "PrintfulError";
|
||||
}
|
||||
|
||||
toResponse() {
|
||||
return new Response(JSON.stringify({ error: this.message }), {
|
||||
status: this.status,
|
||||
headers: { 'content-type': 'application/json' }
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,13 @@ export class WebflowError extends Error {
|
||||
public status: number = 502
|
||||
) {
|
||||
super(message);
|
||||
this.name = "WebflowError";
|
||||
}
|
||||
|
||||
toResponse() {
|
||||
return new Response(JSON.stringify({ error: this.message }), {
|
||||
status: this.status,
|
||||
headers: { 'content-type': 'application/json' }
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user