Skip to content

Commit

Permalink
src/api: Hide error message if account don't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
sogehige committed Sep 3, 2018
1 parent 090e215 commit 93f0946
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/bot/api.js
Expand Up @@ -944,8 +944,10 @@ class API {
})
global.panel.io.emit('api.stats', { data: request.data, timestamp: _.now(), call: 'fetchAccountAge', api: 'kraken', endpoint: url, code: request.status })
} catch (e) {
global.log.error(`API: ${url} - ${e.stack}`)
global.panel.io.emit('api.stats', { timestamp: _.now(), call: 'fetchAccountAge', api: 'kraken', endpoint: url, code: `${e.status} ${_.get(e, 'body.message', e.statusText)}` })
if (e.response.status !== 422) {
global.log.error(`API: ${url} - ${e.stack}`)
global.panel.io.emit('api.stats', { timestamp: _.now(), call: 'fetchAccountAge', api: 'kraken', endpoint: url, code: `${e.status} ${_.get(e, 'body.message', e.statusText)}` })
}
return
}
d(request.data)
Expand Down

0 comments on commit 93f0946

Please sign in to comment.