Submit stack traces as strings

Hi there,

I have an issue with the new React Error Boundaries and source maps.

Sometimes errors produced by Error Boundaries don’t have a stack trace, however the info object (second parameter of componentDidCatch contains a componentStack field with a stack trace like string. I’m sending that stack trace to Sentry in the extra field, but of course, no source maps are applied to it so it is kind of useless.

I wonder if it would make sense for Sentry to provide a fields where you can manually add a stack trace as a string? That would solve my issue and potentially similar issues where stack traces are not obtained the standard way.

You could send it via the standard payload, you just can’t send it as an arbitrary string (how would we know what each attribute is?).

You’d need to do something like the core capture methods (I dont konw the API spec in JS), and send it as exception -> {values: [{stacktrace: {frames: [...]}}]}.

https://docs.sentry.io/clientdev/interfaces/exception/

https://docs.sentry.io/clientdev/interfaces/stacktrace/