Skip to content

Commit

Permalink
Extend error logging to see bfx api errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ZIMkaRU committed Jun 16, 2023
1 parent 19e5b7f commit 7be9cf8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion workers/loc.api/responder/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,19 @@ const _getErrorMetadata = (args, err) => {
data = null
} = errWithMetadata

const _message = err?.status
? `${message}
- BFX_API_STATUS: ${err.status}
- BFX_API_STATUS_TEXT: ${err.statustext ?? 'Status text is not abailable'}
- BFX_API_RAW_BODY_CODE: ${err.code ?? 'Code is not abailable'}
- BFX_API_RAW_BODY_RESPONSE: ${err.response ?? 'Response is not abailable'}`
: message

const error = Object.assign(
errWithMetadata,
{
statusCode: code,
statusMessage: message,
statusMessage: _message,
data
}
)
Expand Down

0 comments on commit 7be9cf8

Please sign in to comment.