-
-
Notifications
You must be signed in to change notification settings - Fork 135
feat: Sensible non-Error exception serializer #416
Conversation
if (!(err instanceof Error)) { | ||
if (utils.isPlainObject(err)) { | ||
// This will allow us to group events based on top-level keys | ||
// which is much better than creating new group when any key/value change |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Damn, that's a great idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, that's awesome kamil. do they need to be hashed? I guess it's a length thing, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without hashing, very large objects will create way too large fingerprints. This way it's always fixed length as you mentioned.
lib/client.js
Outdated
// This will allow us to group events based on top-level keys | ||
// which is much better than creating new group when any key/value change | ||
var hash = md5(Object.keys(err).sort()); | ||
var message = 'Sentry: non-Error exception captured [' + hash + ']'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know that we need to prefix Sentry:
here.
What about:
Non-Error exception captured with keys foo, bar, ...
^Something like that, only showing the first 2 or 3 keys. That'll be more grokkable than the fingerprint.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
Initial attempt to tackle #316 and #187