I’d like to log production errors to a database. I know it’s possible to override the default Ionic Error Handler. But is it possible/better to decorate the exception handler to provide more functionality (without removing the original functionality)?
It seems dangerous to override the default Ionic error handler class. What does the class do? Will my override break important behavior? How will I keep my class up to date with any future Ionic class changes?
I saw the following custom class stub here on the forum and maybe it’s as simple as using this?
Hello, where do I look up the properties of err.
I would like to log/display the context where the error occurred at least the file if not the method.
Is that possible?
Right now I get something like this
Runtime Error
_this.DataList.forEach is not a function
Stack
TypeError: _this.DataList.forEach is not a function
at SafeSubscriber._next (http://localhost:8100/build/main.js:26665:32)
at SafeSubscriber.__tryOrUnsub (http://localhost:8100/build/main.js:46061:16)
at SafeSubscriber.next (http://localhost:8100/build/main.js:46010:22)
at Subscriber._next (http://localhost:8100/build/main.js:45963:26)
at Subscriber.next (http://localhost:8100/build/main.js:45927:18)
at MapSubscriber._next (http://localhost:8100/build/main.js:111737:26)
at MapSubscriber.Subscriber.next (http://localhost:8100/build/main.js:45927:18)
at XMLHttpRequest.onLoad (http://localhost:8100/build/main.js:56046:38)
at t.invokeTask (http://localhost:8100/build/polyfills.js:3:9723)
at Object.onInvokeTask (http://localhost:8100/build/main.js:36933:37)
Ionic Framework: ^2.0.0
Ionic Native: 2.4.1
Ionic App Scripts: 1.0.0
Angular Core: 2.2.1
Angular Compiler CLI: 2.2.1
Node: 7.2.0
OS Platform: Windows 7
Navigator Platform: Win32
User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36
Is it possible to navigate to a specific support page with an error handler like this? It seems like getting a Nav Controller in this context isn’t possible?