Skip to content

Commit

Permalink
chore: get error from calc
Browse files Browse the repository at this point in the history
  • Loading branch information
matheusgnreis authored Nov 23, 2023
1 parent 2e40202 commit fd40170
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
4 changes: 0 additions & 4 deletions functions/lib/correios-calculate.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ 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 @@ -103,9 +102,6 @@ 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
1 change: 1 addition & 0 deletions functions/routes/ecom/modules/calculate-shipping.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ exports.post = async ({ appSdk }, req, res) => {
correiosResult = data
} catch (err) {
const { response } = err
console.log('erro de calculo', err)
return res.status(409).send({
error: 'CALCULATE_FAILED',
message: response?.data?.[0]?.txErro || err.message
Expand Down

0 comments on commit fd40170

Please sign in to comment.