sindresorhus/electron-timber

Logging an error is correct in the Electron devtools console, but an empty object {} in the terminal output

Closed this issue · 2 comments

	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

What Electron version? I think Electron 8 finally fixed the bug where it doesn’t correctly serialize errors.

That could be why, I'm still using Electron 6 because of this bug: electron/electron#20933.

Cheers!