Skip to content

Commit

Permalink
update errors in sfmc
Browse files Browse the repository at this point in the history
  • Loading branch information
harsh-joshi99 committed Dec 13, 2024
1 parent d9786a2 commit f202f41
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,12 @@ export async function upsertRows(
payloads.forEach((payload, index) => {
multiStatusResponse.setErrorResponseAtIndex(index, {
status: 400,
errormessage: err?.response?.data?.additionalErrors[0]?.message || '',
errormessage:
(err?.response?.data?.additionalErrors &&
err.response.data.additionalErrors.length > 0 &&
err.response.data.additionalErrors[0].message) ||
err?.response?.data?.message ||
'',
sent: payload as Object as JSONLikeObject,
body: JSON.stringify(err)
})
Expand Down

0 comments on commit f202f41

Please sign in to comment.