diff --git a/src/server/utils/api-error.ts b/src/server/utils/api-error.ts index a31f5f0bb..b02e45b00 100644 --- a/src/server/utils/api-error.ts +++ b/src/server/utils/api-error.ts @@ -8,37 +8,37 @@ export class ApiError extends Error { this.statusCode = options.statusCode; } - static badRequest(message: string) { + static badRequest(message?: string) { return new ApiError({ message: message || 'Bad request.', statusCode: 400, }); } - static unauthorized(message: string) { + static unauthorized(message?: string) { return new ApiError({ message: message || 'Unauthorized.', statusCode: 401, }); } - static forbidden(message: string) { + static forbidden(message?: string) { return new ApiError({ message: message || 'Forbidden.', statusCode: 403 }); } - static notFound(message: string) { + static notFound(message?: string) { return new ApiError({ message: message || 'Not found.', statusCode: 404 }); } - static conflict(message: string) { + static conflict(message?: string) { return new ApiError({ message: message || 'Conflict.', statusCode: 409 }); } - static gone(message: string) { + static gone(message?: string) { return new ApiError({ message: message || 'Gone.', statusCode: 410 }); } - static internal(message: string) { + static internal(message?: string) { return new ApiError({ message: message || 'Internal error.', statusCode: 500,