fix: grapQL errors are not detailed enough (#3622)

This commit is contained in:
Jérémy M
2024-02-01 09:45:58 +01:00
committed by GitHub
parent 4290db3566
commit fc01c8cd4f

View File

@ -52,9 +52,9 @@ export const convertHttpExceptionToGraphql = (exception: HttpException) => {
let error: BaseGraphQLError;
if (status in graphQLPredefinedExceptions) {
error = new graphQLPredefinedExceptions[exception.getStatus()](
exception.message,
);
const message = exception.getResponse()['message'] ?? exception.message;
error = new graphQLPredefinedExceptions[exception.getStatus()](message);
} else {
error = new BaseGraphQLError(
'Internal Server Error',