Skip to content

Commit

Permalink
change http exception
Browse files Browse the repository at this point in the history
  • Loading branch information
bahram1249 committed May 8, 2024
1 parent de6502a commit 1e837d5
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions libs/http-exception-filter/src/http-exception.filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,14 @@ export class HttpExceptionFilter implements ExceptionFilter {
}
}

let errors;
let responseBody;
if (exception instanceof I18nValidationException) {
const i18n = I18nContext.current();
errors = formatI18nErrors(exception.errors ?? [], i18n.service, {
const errors = formatI18nErrors(exception.errors ?? [], i18n.service, {
lang: i18n.lang,
});
let normalizedErrors = this.normalizeValidationErrors(errors);
responseBody = this.buildResponseBody(host, exception, normalizedErrors);
} else {
errors = exception.getResponse().valueOf()['message'];
}

if (responseBody) {
Expand Down

0 comments on commit 1e837d5

Please sign in to comment.