Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

feat: Sensible non-Error exception serializer #416

Merged
merged 4 commits into from
Jan 15, 2018
Merged

Conversation

kamilogorek
Copy link
Contributor

Initial attempt to tackle #316 and #187

@kamilogorek kamilogorek requested a review from a team January 11, 2018 14:32
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
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol

Copy link
Contributor

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?

Copy link
Contributor Author

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 + ']';
Copy link
Contributor

@benvinegar benvinegar Jan 11, 2018

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants