Skip to content

Commit

Permalink
replaced splitter (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
yartman authored Oct 6, 2021
1 parent aa925a9 commit aefa42a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/dsb-message-broker/src/message/error.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {

export const HttpMessageErrorHandler = (error: any) => {
if (error instanceof PayloadNotValidError) {
const errors = error.message.split('>');
const errors = error.message.split('$reason->');
throw new BadRequestException({
statusCode: 400,
message: [errors[0], ...JSON.parse(errors[1])],
Expand Down
6 changes: 5 additions & 1 deletion apps/dsb-message-broker/src/message/error/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ export class UnauthorizedToSubscribeError extends Error {

export class PayloadNotValidError extends Error {
constructor(topic: string, message: string) {
super(`Payload does not match the schema for the topic(${topic ?? 'default'}).>${message}`);
super(
`Payload does not match the schema for the topic(${
topic ?? 'default'
}).$reason->${message}`
);
}
}

0 comments on commit aefa42a

Please sign in to comment.