Skip to content

Commit

Permalink
improve error thrown
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsonogwuru committed Mar 4, 2024
1 parent 683ec57 commit 63cb46f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions processor/src/services/converters/notification.converter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TransactionData, UpdatePayment } from '@commercetools/connect-payments-sdk';
import { ErrorGeneral, TransactionData, UpdatePayment } from '@commercetools/connect-payments-sdk';
import { COCOTransactionStates, COCOTransactionTypes, NotificationEventType } from '../types/paypal-payment.type';
import { Money } from '@commercetools/platform-sdk';
import { NotificationPayloadDTO, NotificationResourceDTO } from '../../dtos/paypal-payment.dto';
Expand Down Expand Up @@ -42,8 +42,11 @@ export class NotificationConverter {
interactionId: item.resource.id,
};
default:
// TODO: improve this error handling
throw new Error('Unsupported');
throw new ErrorGeneral('Unsupported event type', {
fields: {
event_type: item.event_type,
},
});
}
}

Expand Down

0 comments on commit 63cb46f

Please sign in to comment.