diff --git a/src/app-gocardless/app-gocardless.js b/src/app-gocardless/app-gocardless.js index 9c1d1f05f..5d2fe00e2 100644 --- a/src/app-gocardless/app-gocardless.js +++ b/src/app-gocardless/app-gocardless.js @@ -205,7 +205,7 @@ app.post( case isAxiosError(error): console.log( 'Something went wrong', - inspect(error.response.data, { depth: null }), + inspect(error.response?.data || error, { depth: null }), ); sendErrorResponse({ error_type: 'SYNC_ERROR', diff --git a/upcoming-release-notes/282.md b/upcoming-release-notes/282.md new file mode 100644 index 000000000..ad88f3169 --- /dev/null +++ b/upcoming-release-notes/282.md @@ -0,0 +1,6 @@ +--- +category: Enhancements +authors: [MatissJanis] +--- + +Improved error handling of GoCardless issues