Last active
December 23, 2015 18:31
-
-
Save algogrit/b6da89564b75196bdf7b to your computer and use it in GitHub Desktop.
Airbrake wrap / notice annotations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
renderWrapper = airBrakeClient.wrap(render); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var renderWrapper = () => { | |
try { | |
return render(); | |
} catch(err) { | |
airBrakeClient.notify({ | |
error: err, | |
environment: { nodeEnvironment: NODE_ENV }, | |
params: { | |
currentUser: currentUserParams, | |
state: stateParams | |
} | |
}); | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
renderWrapper = airBrakeClient.wrap(render, function(err) { | |
return { | |
error: err, | |
environment: { nodeEnvironment: NODE_ENV }, | |
params: { | |
currentUser: currentUserParams, | |
state: stateParams | |
} | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment