Skip to content

Commit

Permalink
chore: set log to get error 400
Browse files Browse the repository at this point in the history
  • Loading branch information
matheusgnreis authored Nov 23, 2023
1 parent d533809 commit 2e40202
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions functions/lib/correios-calculate.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const calculate = async ({
}
})
const debugError = (err) => {
console.log('teve erro', err)
if (err.response) {
logger.warn(`[calculate] failed for #${storeId}`, {
body: err.config.data,
Expand Down Expand Up @@ -102,6 +103,9 @@ const calculate = async ({
}, { timeout })
.catch(debugError)
]).then((responses) => {
if (storeId == 4566) {
console.log('retorno calculo', responses)
}
responses[1].data.forEach(({ coProduto, ...value }) => {
const result = responses[0].data.find((result) => result.coProduto === coProduto)
if (result) {
Expand Down

0 comments on commit 2e40202

Please sign in to comment.