Logging an error is correct in the Electron devtools console, but an empty object {} in the terminal output
Closed this issue · 2 comments
lacymorrow commented
import { shell } from 'electron'
try {
await shell.openExternal( resource )
} catch ( error ) {
// displays `{}` in the terminal
logger.log( error )
// prints the strings in the terminal
logger.log( error.message, error.stack )
}
This seems to be related: https://stackoverflow.com/a/38513494/939330
sindresorhus commented
What Electron version? I think Electron 8 finally fixed the bug where it doesn’t correctly serialize errors.
lacymorrow commented
That could be why, I'm still using Electron 6 because of this bug: electron/electron#20933.
Cheers!