microsoft / jacdac

Device and service catalogs for Jacdac.
https://aka.ms/jacdac
Creative Commons Attribution 4.0 International
66 stars 25 forks source link

VM should catch all exception and expose a error event #395

Closed pelikhan closed 3 years ago

pelikhan commented 3 years ago

If anything decides to crash on the VM, we should not crash the UI.

tballmsft commented 3 years ago

what do mean "expose an error event"? Do you have an example?

pelikhan commented 3 years ago

use

this.emit(ERROR, e)

to emit the error and the UI will handle it. Either show in UI or using AppContext setError.

pelikhan commented 3 years ago

https://github.com/microsoft/jacdac-docs/blob/ff0a2ad0b2fee956c34248c52334eedb82a17342/src/components/vm/VmEditor.tsx#L66

tballmsft commented 3 years ago

@pelikhan - I now catch exceptions and expose ERROR event everywhere now, can you please do UI work?

pelikhan commented 3 years ago

Yup will do. Are those error surfaced on the vmrunner instance?

tballmsft commented 3 years ago

yes