summaryrefslogtreecommitdiff
path: root/packages/backend/src/misc/fastify-reply-error.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/backend/src/misc/fastify-reply-error.ts')
-rw-r--r--packages/backend/src/misc/fastify-reply-error.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/packages/backend/src/misc/fastify-reply-error.ts b/packages/backend/src/misc/fastify-reply-error.ts
new file mode 100644
index 0000000000..4e987175e2
--- /dev/null
+++ b/packages/backend/src/misc/fastify-reply-error.ts
@@ -0,0 +1,11 @@
+// https://www.fastify.io/docs/latest/Reference/Reply/#async-await-and-promises
+export class FastifyReplyError extends Error {
+ public message: string;
+ public statusCode: number;
+
+ constructor(statusCode: number, message: string) {
+ super(message);
+ this.message = message;
+ this.statusCode = statusCode;
+ }
+}