|
|
@@ -8,6 +8,7 @@ import { PrivateHandler } from './handlers/private-handler.class';
|
|
|
import { PublicHandler } from './handlers/public-handler.class';
|
|
|
|
|
|
import { AuthenticationException } from './model/err/authentication.exception';
|
|
|
+import { HttpStatusException } from './model/err/http-status.exception';
|
|
|
|
|
|
const multipartMiddleware = multiparty();
|
|
|
|
|
|
@@ -67,6 +68,8 @@ export class Webserver {
|
|
|
try {
|
|
|
if (err instanceof AuthenticationException) {
|
|
|
res.status(err.statusCode).send(err.statusText);
|
|
|
+ } else if (err instanceof HttpStatusException) {
|
|
|
+ res.status(err.statusCode).send(err.message);
|
|
|
} else if (Object.keys(err).includes('code') && err.code === 'EBADCSRFTOKEN') {
|
|
|
res.status(403).send(err.message);
|
|
|
} else {
|