Files
twenty/packages/twenty-server/src/engine/metadata-modules/remote-server/remote-server.exception.ts
Thomas Trompette a15884ea0a Add exceptions for metadata modules (#6070)
Class exception for each metadata module + handler to map on graphql
error

TODO left :
- find a way to call handler on auto-resolvers nestjs query (probably
interceptors)
- discuss what should be done for pre-hooks errors
- discuss what should be done for Unauthorized exception
2024-07-01 13:49:17 +02:00

17 lines
629 B
TypeScript

import { CustomException } from 'src/utils/custom-exception';
export class RemoteServerException extends CustomException {
code: RemoteServerExceptionCode;
constructor(message: string, code: RemoteServerExceptionCode) {
super(message, code);
}
}
export enum RemoteServerExceptionCode {
REMOTE_SERVER_NOT_FOUND = 'REMOTE_SERVER_NOT_FOUND',
REMOTE_SERVER_ALREADY_EXISTS = 'REMOTE_SERVER_ALREADY_EXISTS',
REMOTE_SERVER_MUTATION_NOT_ALLOWED = 'REMOTE_SERVER_MUTATION_NOT_ALLOWED',
REMOTE_SERVER_CONNECTION_ERROR = 'REMOTE_SERVER_CONNECTION_ERROR',
INVALID_REMOTE_SERVER_INPUT = 'INVALID_REMOTE_SERVER_INPUT',
}