Files
twenty/packages/twenty-server/src/engine/twenty-orm/exceptions/twenty-orm.exception.ts
Charles Bochet 3c4168759a Refactor metadata caching (#7011)
This PR introduces the following changes:
- add the metadataVersion to all our metadata cache keys to ease
troubleshooting:
<img width="1146" alt="image"
src="https://github.com/user-attachments/assets/8427805b-e07f-465e-9e69-1403652c8b12">
- introduce a cache recompute lock to avoid overloading the database to
recompute the cache many time
2024-09-12 16:06:19 +02:00

16 lines
536 B
TypeScript

import { CustomException } from 'src/utils/custom-exception';
export class TwentyORMException extends CustomException {
code: TwentyORMExceptionCode;
constructor(message: string, code: TwentyORMExceptionCode) {
super(message, code);
}
}
export enum TwentyORMExceptionCode {
METADATA_VERSION_NOT_FOUND = 'METADATA_VERSION_NOT_FOUND',
METADATA_VERSION_MISMATCH = 'METADATA_VERSION_MISMATCH',
METADATA_COLLECTION_NOT_FOUND = 'METADATA_COLLECTION_NOT_FOUND',
WORKSPACE_SCHEMA_NOT_FOUND = 'WORKSPACE_SCHEMA_NOT_FOUND',
}