-
-
Notifications
You must be signed in to change notification settings - Fork 60
Closed
Description
- Review the documentation: https://docs.sentry.io/platforms/javascript/electron/
- Search for existing issues: https://github.com/getsentry/sentry-electron/issues
- Use the latest release: https://github.com/getsentry/sentry-electron/releases
- Provide a link to the affected event from your Sentry account
Versions + Platform
- SDK version -
@sentry/[email protected] - Electron version -
[email protected] - Platform -
macOS
Description
When capturing a exception thrown by the Node integration in the renderer process, the reported stacktrace is empty.
Sample code to reproduce:
const exec = promisify(childProcess.exec);
const command = `commandThatFails`;
let stdout: string;
try {
const response = await exec(command);
stdout = response.stdout;
} catch (error) {
console.log('got error', error);
stdout = error.stdout;
if (!stdout) {
Sentry.captureException(error);
}
}The console prints the following (we can see here the value of error.stack):
got error Error: Command failed: commandThatFails
/bin/sh: commandThatFails: command not found
at ChildProcess.exithandler (child_process.js:312)
at ChildProcess.emit (events.js:315)
at maybeClose (internal/child_process.js:1021)
at Socket.<anonymous> (internal/child_process.js:443)
at Socket.emit (events.js:315)
at Pipe.<anonymous> (net.js:674)
The error is correctly reported when calling Sentry.captureException(error) but in the Sentry web interface the stacktrace is empty. Only the first two lines appear:
Command failed: commandThatFails
/bin/sh: commandThatFails: command not found
It seems the Sentry client tries to parse the stack as a Chrome stack, but as the error comes from the Node integration, the format does not match and all frames are skipped.
Metadata
Metadata
Assignees
Labels
No labels