mirror of
https://github.com/usatiuk/photos.git
synced 2025-10-28 23:37:48 +01:00
fix weird photo test
This commit is contained in:
@@ -7,6 +7,7 @@ import send = require("koa-send");
|
||||
import { getHash, getSize } from "~util";
|
||||
import * as jwt from "jsonwebtoken";
|
||||
import { config } from "~config";
|
||||
import { ValidationError } from "class-validator";
|
||||
|
||||
export const photosRouter = new Router();
|
||||
|
||||
@@ -48,6 +49,13 @@ photosRouter.post("/photos/new", async (ctx) => {
|
||||
} as IPhotosNewRespBody;
|
||||
return;
|
||||
}
|
||||
if (
|
||||
e.name === "ValidationError" ||
|
||||
(Array.isArray(e) && e.some((e) => e instanceof ValidationError))
|
||||
) {
|
||||
ctx.throw(400);
|
||||
return;
|
||||
}
|
||||
console.log(e);
|
||||
ctx.throw(500);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user