Describe the bug
When an error occurs in the background, it's not serialized correctly when sent to the UI. The error arrives as a plain object with its stack missing, so the resulting Sentry reports are difficult to debug.
Expected behavior
The error should still have a type of Error and should retain its stack when sent from the background to the UI.