Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release version to master #362

Merged
merged 6 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bfx-report",
"version": "4.10.0",
"version": "4.10.1",
"description": "Reporting tool",
"main": "worker.js",
"license": "Apache-2.0",
Expand Down
13 changes: 12 additions & 1 deletion workers/loc.api/helpers/get-data-from-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ module.exports = (
let countNetError = 0
let countRateLimitError = 0
let countNonceSmallError = 0
let countUnexpectedError = 0
let res = null

while (true) {
Expand Down Expand Up @@ -157,7 +158,17 @@ module.exports = (
continue
}

throw err
// Handle unexpected BFX API errors
countUnexpectedError += 1

if (countUnexpectedError > 3) {
throw err
}
if (_isInterrupted(_interrupter)) {
return { isInterrupted: true }
}

await _delay(10000, _interrupter)
}
}

Expand Down
15 changes: 9 additions & 6 deletions workers/loc.api/responder/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ const _getErrorWithMetadataForNonBaseError = (args, err) => {
return err
}

const _getErrorMetadata = (args, err) => {
const _getErrorMetadata = (args, err, name) => {
const errWithMetadata = _getErrorWithMetadataForNonBaseError(args, err)
_addStatusMessageToErrorMessage(errWithMetadata)
const {
Expand Down Expand Up @@ -178,8 +178,10 @@ const _getErrorMetadata = (args, err) => {
data: extendedData
}
)
const serializedError = _prepareErrorData(error, name)
Object.assign(error, { serializedError })

return { code, message, data, error }
return { code, message, data, error, serializedError }
}

const _logError = (loggerArgs, err) => {
Expand All @@ -195,21 +197,22 @@ const _logError = (loggerArgs, err) => {
)
const {
code,
error
} = _getErrorMetadata(args, err)
error,
serializedError
} = _getErrorMetadata(args, err, name)

_emitEventByWs(loggerArgs, error)

if (
code !== 500 ||
shouldNotBeLoggedToStdErrorStream
) {
logger.debug(_prepareErrorData(error, name))
logger.debug(serializedError)

return
}

logger.error(_prepareErrorData(error, name))
logger.error(serializedError)
}

const _emitEventByWs = (emitterArgs, error) => {
Expand Down
Loading