tethys.backend/app/Exceptions/OaiErrorCodes.ts
Arno Kaimbacher 4714dfdd94
All checks were successful
CI Pipeline / japa-tests (push) Successful in 46s
- use latest prettier 3.0 with eslint-plugin-prettier: 5.0.0-alpha.2
- npm normal updates
- add all xslt and style asstes in extra folder public/assets2
- linting corrections
- delete local .env.test from git tracking: git rm --cached .env.test
- add .env.test into .gitignore file
- add edit functionality for editing by submitter
- npm updates
-added xslt3 packeage for builfing sef files
- added Language.ts class vor language table
- added version to datasetxml2oai-pmh.xslt
2023-07-17 19:13:30 +02:00

49 lines
1.5 KiB
TypeScript

export enum OaiErrorCodes {
BADVERB = 1010,
BADARGUMENT = 1011,
CANNOTDISSEMINATEFORMAT = 1012,
BADRESUMPTIONTOKEN = 1013,
NORECORDSMATCH = 1014,
IDDOESNOTEXIST = 1015,
}
// 👇️ default export
// export { OaiErrorCodes };
// https://medium.com/@juliapassynkova/map-your-typescript-enums-e402d406b229
export const OaiModelError = new Map<number, string>([
[OaiErrorCodes.BADVERB, 'badVerb'],
[OaiErrorCodes.BADARGUMENT, 'badArgument'],
[OaiErrorCodes.NORECORDSMATCH, 'noRecordsMatch'],
[OaiErrorCodes.CANNOTDISSEMINATEFORMAT, 'cannotDisseminateFormat'],
[OaiErrorCodes.BADRESUMPTIONTOKEN, 'badResumptionToken'],
[OaiErrorCodes.IDDOESNOTEXIST, 'idDoesNotExist'],
]);
// class OaiModelError {
// // const BADVERB = 1010;
// // const BADARGUMENT = 1011;
// // const CANNOTDISSEMINATEFORMAT = 1012;
// // const BADRESUMPTIONTOKEN = 1013;
// // const NORECORDSMATCH = 1014;
// // const IDDOESNOTEXIST = 1015;
// protected static $oaiErrorCodes = {
// OaiErrorCodes. 'badVerb',
// BADARGUMENT : 'badArgument',
// NORECORDSMATCH: 'noRecordsMatch',
// CANNOTDISSEMINATEFORMAT: 'cannotDisseminateFormat',
// BADRESUMPTIONTOKEN: 'badResumptionToken',
// IDDOESNOTEXIST: 'idDoesNotExist',
// };
// public static function mapCode($code)
// {
// if (false === array_key_exists($code, self::$oaiErrorCodes)) {
// throw new OaiModelException("Unknown oai error code $code");
// }
// return self::$oaiErrorCodes[$code];
// }
// }