Cast typeorm QueryFailedError to BadRequestException for the rest api (#12217)

This commit is contained in:
martmull
2025-05-23 17:00:45 +02:00
committed by GitHub
parent 362d540aac
commit 88b967dfb8
3 changed files with 37 additions and 8 deletions

View File

@ -10,6 +10,7 @@ import {
BillingExceptionCode,
} from 'src/engine/core-modules/billing/billing.exception';
import { HttpExceptionHandlerService } from 'src/engine/core-modules/exception-handler/http-exception-handler.service';
import { CustomException } from 'src/utils/custom-exception';
@Catch(BillingException, Stripe.errors.StripeError)
export class BillingRestApiExceptionFilter implements ExceptionFilter {
@ -30,7 +31,7 @@ export class BillingRestApiExceptionFilter implements ExceptionFilter {
code: BillingExceptionCode.BILLING_STRIPE_ERROR,
message: exception.message,
name: 'StripeError',
},
} as CustomException,
response,
400,
);