feat: handle http exceptions (#456)

This commit is contained in:
Ahmed Bouhuolia
2024-05-22 19:30:41 +02:00
committed by GitHub
parent 1227111fae
commit 0836fe14e0
14 changed files with 102 additions and 66 deletions

View File

@@ -16,7 +16,7 @@ export class ImportController extends BaseController {
/**
* Router constructor method.
*/
router() {
public router() {
const router = Router();
router.post(
@@ -240,11 +240,7 @@ export class ImportController extends BaseController {
errors: [{ type: 'IMPORTED_FILE_EXTENSION_INVALID' }],
});
}
return res.status(400).send({
errors: [{ type: error.errorType }],
});
}
next(error);
}
}