Skip to content

Commit

Permalink
Don't block on failed network (#120)
Browse files Browse the repository at this point in the history
* Don't block on failed network

* log behind debug flag
  • Loading branch information
pselle committed Apr 20, 2017
1 parent 6060a57 commit d84a95d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions index.js
Expand Up @@ -159,9 +159,10 @@ function _make_generateLog(metrics, func, start_time, config, context) {
timeout: config.network_timeout,
},
function(err) {
// Throw uncaught errors from the wrapped function.
if (err) {
context.fail(err)
// Log errors, don't block on failed requests
if (err && config.debug) {
console.log('Write to IOpipe failed:')
console.log(err)
}
callback()
}
Expand Down

0 comments on commit d84a95d

Please sign in to comment.