Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: I18nValidationExceptionFilter error response body
  • Loading branch information
Jeel-Parikh committed Aug 1, 2024
commit a19082e7a5a1420f06619d1c53694d6627ca7fe6
8 changes: 4 additions & 4 deletions src/filters/i18n-validation-exception.filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,18 +90,18 @@ export class I18nValidationExceptionFilter implements ExceptionFilter {
protected buildResponseBody(
host: ArgumentsHost,
exc: I18nValidationException,
errors: string[] | I18nValidationError[] | object,
error: string[] | I18nValidationError[] | object,
) {
if ('responseBodyFormatter' in this.options) {
return this.options.responseBodyFormatter(host, exc, errors);
return this.options.responseBodyFormatter(host, exc, error);
} else {
return {
statusCode:
this.options.errorHttpStatusCode === undefined
? exc.getStatus()
: this.options.errorHttpStatusCode,
message: exc.getResponse(),
errors,
message: error,
error: exc.getResponse(),
};
}
}
Expand Down