Skip to content

Instantly share code, notes, and snippets.

@renanccastro
Last active October 5, 2020 17:29
Show Gist options
  • Save renanccastro/a907af57713bede29766f8150a6c97c1 to your computer and use it in GitHub Desktop.
Save renanccastro/a907af57713bede29766f8150a6c97c1 to your computer and use it in GitHub Desktop.
function getTrace(err, type, subType) {
return {
type: type,
subType: subType,
name: err.message,
errored: true,
at: Kadira.syncedDate.getTime(),
events: [
['start', 0, {}],
['error', 0, {error: {message: err.message, stack: err.stack}}]
],
metrics: {
total: 0
}
};
}
try{
somethingThatThrowsError();
}catch(error){
const trace = getTrace(error, 'server-internal', 'error');
Kadira.models.error.trackError(error, trace);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment