Skip to content

Commit

Permalink
fix(webhook ecom): Update debug errors
Browse files Browse the repository at this point in the history
  • Loading branch information
wisley7l committed Nov 24, 2023
1 parent 6ccb140 commit 5a36888
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions functions/routes/ecom/webhook.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,11 @@ exports.post = async ({ appSdk, admin }, req, res) => {
console.warn(`>> StoreApi webhook: Document does not exist Firestore, order #${resourceId}, not found`)
status = 404
} else {
console.error('> Error editing subscription => ', err)
if (response && response.data) {
console.error('> Error editing subscription => ', JSON.stringify(response.data))
} else {
console.error('> Error editing subscription => ', err)
}
}

res.status(status).send({
Expand Down Expand Up @@ -368,8 +372,9 @@ exports.post = async ({ appSdk, admin }, req, res) => {
}
} catch (err) {
console.error(`Error trying to update signature #${subscription.myId}`)
if (err?.response) {
console.error('Error: ', err?.response, ' <')
if (error.response) {
const { status, data } = error.response
console.log('Error: ', status, ' ', data && JSON.stringify(data))
}
error = err
}
Expand Down

0 comments on commit 5a36888

Please sign in to comment.