- throw badVerb for oai.controller if no or bad verb is defined
This commit is contained in:
parent
69bc8e4b75
commit
9eef31fbd8
|
@ -187,13 +187,18 @@ export class OaiController {
|
|||
this.handleIllegalVerb();
|
||||
}
|
||||
} else {
|
||||
// try {
|
||||
// console.log("Async code example.")
|
||||
const err = new PageNotFoundException("verb not found");
|
||||
throw err;
|
||||
// } catch (error) { // manually catching
|
||||
// next(error); // passing to default middleware error handler
|
||||
// }
|
||||
// // try {
|
||||
// // console.log("Async code example.")
|
||||
// const err = new PageNotFoundException("verb not found");
|
||||
// throw err;
|
||||
// // } catch (error) { // manually catching
|
||||
// // next(error); // passing to default middleware error handler
|
||||
// // }
|
||||
throw new OaiModelException(
|
||||
StatusCodes.INTERNAL_SERVER_ERROR,
|
||||
"The verb provided in the request is illegal.",
|
||||
OaiErrorCodes.BADVERB,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ export enum OaiErrorCodes {
|
|||
|
||||
// https://medium.com/@juliapassynkova/map-your-typescript-enums-e402d406b229
|
||||
export const OaiModelError = new Map<number, string>([
|
||||
[OaiErrorCodes.BADARGUMENT, 'badVerb'],
|
||||
[OaiErrorCodes.BADVERB, 'badVerb'],
|
||||
[OaiErrorCodes.BADARGUMENT, 'badArgument'],
|
||||
[OaiErrorCodes.NORECORDSMATCH, 'noRecordsMatch'],
|
||||
[OaiErrorCodes.CANNOTDISSEMINATEFORMAT, 'cannotDisseminateFormat'],
|
||||
|
|
Loading…
Reference in New Issue
Block a user