Piles of console error when http fails
TanayBhalani opened this issue · comments
The console.error can be replaced to throwError of rxjs or throw of javascript to prevent the piles of error in console when i do not want.
I faced issue of http error when network was down, and the console was constantly filled with errors, which i have no control on
if the methods throws error i can create a try catch block while subscribing the observable and decide what i want to do of error
You can check my example to understand the scenario
https://angular-ivy-jzg6ya.stackblitz.io
Repro steps
- Click on Start Monitoring button
- Open console
- Disconnect your device from internet
- Observe the console
Note: I have kept try catch block around subscribeMonitor() Method in service check-connection.service.ts but its not able to catch because of console.error() implemented inside the method
okay, I will look into it
Hi @TanayBhalani, please check new version upgrade 9.0.3. Now throwing error when heartBeatUrl is not reachable. You can catch it and handle per your business logic.