Skip to content

Commit

Permalink
errortype will be inferred from the error.response.status
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaurav Kochar committed Oct 23, 2024
1 parent f1a55ff commit bf47bce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ describe('MultiStatus', () => {
// The first doesn't fail as there is no error reported by Braze API
expect(response[0]).toMatchObject({
status: 400,
errortype: 'PAYLOAD_VALIDATION_FAILED',
errortype: 'BAD_REQUEST',
errormessage: 'Invalid email address',
sent: {
profile: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ function handleKlaviyoAPIErrorResponse(
if (indexInOriginalPayload !== -1 && !multiStatusResponse.isErrorResponseAtIndex(indexInOriginalPayload)) {
multiStatusResponse.setErrorResponseAtIndex(indexInOriginalPayload, {
status: error.status,
errortype: 'PAYLOAD_VALIDATION_FAILED',
// errortype will be inferred from the error.response.status
errormessage: error.detail,
sent: payloads[indexInOriginalPayload],
body: JSON.stringify(error)
Expand Down

0 comments on commit bf47bce

Please sign in to comment.