Discarded invalid parameter

SDK: raven-js@3.24.2

I have been playing cat and mouse with Sentry all day to log additional data when an exception is caught Raven.captureException(new Error("The thing that went wrong"), additionalData);. The keys/parameters in the additionalData object keep getting discarded.

So far, the objects keys that have been discarded are:

  • error
  • error_code
  • error_message
  • requestId
  • request_identifier

And the only key that I’ve been able to have work successfully is message.

I cannot find any documentation on what parameters are valid in this object. Has anyone else been able to reverse engineer the parameter validation checks that Sentry is doing?

Ok, so I got it working by providing the additionalData at the extra.

Raven.captureException(new Error(message), { extra: additionalData });

I think the JS docs here could be updated to make this more obvious.