This PR attemps at improving sentry grouping and filtering by - Using the exceptionCode as the fingerprint when the error is a customException. For this to work in this PR we are now throwing customExceptions instead of internalServerError deprived of their code. They will still be converted to Internal server errors when sent back as response - Filtering 4xx issues where it was missing (for emailVerification because errors were not handled, for invalid captcha and billing errors because they are httpErrors and not graphqlErrors) --------- Co-authored-by: Félix Malfait <felix@twenty.com>
16 lines
546 B
TypeScript
16 lines
546 B
TypeScript
import { CustomException } from 'src/utils/custom-exception';
|
|
|
|
export class RelationMetadataException extends CustomException {
|
|
declare code: RelationMetadataExceptionCode;
|
|
constructor(message: string, code: RelationMetadataExceptionCode) {
|
|
super(message, code);
|
|
}
|
|
}
|
|
|
|
export enum RelationMetadataExceptionCode {
|
|
RELATION_METADATA_NOT_FOUND = 'RELATION_METADATA_NOT_FOUND',
|
|
INVALID_RELATION_INPUT = 'INVALID_RELATION_INPUT',
|
|
RELATION_ALREADY_EXISTS = 'RELATION_ALREADY_EXISTS',
|
|
FOREIGN_KEY_NOT_FOUND = 'FOREIGN_KEY_NOT_FOUND',
|
|
}
|