You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I use FabricModule.forRoot() , angular app crashes super easily.
For example, following TypeScript codes will cause JavaScript error.
let x: any = {};
let msg = x.y.getMessage(); // This line causes -> TypeError: undefined is not an object (evaluating 'x.y.getMessage')
Without using FabricModule.forRoot(), the line shows JavaScript errors on console but apps do NOT crash. However if you use FabricModule.forRoot(), the line causes instant app freeze and crash.
It seems following line of errorhandler.ts causes app crash:
If I commented out throw err;, apps stop crashing.
In development, this crash behavior is acceptable. But in production, app crash can seriously hurt your app's credibility. So do you think you could replace throw err; with simple console output something like following:
console.error(err, err.stack);
The text was updated successfully, but these errors were encountered:
this behaviour is intentional: An Angular Error Handler should catch errors, handle it with his own logic and rethrow it. Why should you use an ErrorHandler if you don't want to handle it?
@hypery2k If this behaviour is intentional as you said, I think it should be documented somewhere. Although I wanted to handle errors, I didn't expect that adding this ErrorHandler would cause unexpected crash in production. Currently adding the ErrorHandler is documented as if it is setup procedure. If I had known the side-effect of FabricModule.forRoot(), I would not use it.
got it, would like to make it configurable, but not having time for this. I removed the rethrow. If the CI build went through, you can give the @next version a try.
If I use
FabricModule.forRoot()
, angular app crashes super easily.For example, following TypeScript codes will cause JavaScript error.
Without using
FabricModule.forRoot()
, the line shows JavaScript errors on console but apps do NOT crash. However if you useFabricModule.forRoot()
, the line causes instant app freeze and crash.It seems following line of
errorhandler.ts
causes app crash:nativescript-fabric/src/app/errorhandler.ts
Line 60 in d35bf91
If I commented out
throw err;
, apps stop crashing.In development, this crash behavior is acceptable. But in production, app crash can seriously hurt your app's credibility. So do you think you could replace
throw err;
with simple console output something like following:The text was updated successfully, but these errors were encountered: