pcb icon indicating copy to clipboard operation
pcb copied to clipboard

Advanced Error Handling

Open rriverak opened this issue 7 years ago • 6 comments

Hi, first many thanks for this great Project. We need to ensure that our application is always available offline. Always in the latest version.

For this purpose, we have build a loadingscreen to process this. However, there are some problems which we want to handle.

Here is a Sample from ServiceWorker:

DOMException: Quota exceeded.
Uncaught (in promise) DOMException: Quota exceeded.

Its possible to pass this exceptions and Errors to the onUpdateFailed event ? We want to give the user better error messages.

Of course, the error messages are not really cross browser but we'll take what we get :)

rriverak avatar Apr 26 '17 10:04 rriverak

Hi, thank you. It's probably possible to do that, but how did you manage to exceed the quota? It's at least 50MB for worst scenario (no free space on the device).

NekR avatar Apr 26 '17 14:04 NekR

or... is that AppCache error?

NekR avatar Apr 26 '17 14:04 NekR

Hi, it´s a ServiceWorker Error. We would like more details than "broken". It would help our support team solve problems.

Quota is just one example... I have provoked this in which I have filled my hard disk to 99%.

rriverak avatar Apr 26 '17 14:04 rriverak

I see. That makes sense, but unfortunately it isn't very straightforward to get the error of fail. I'll think about it :-)

NekR avatar Apr 26 '17 14:04 NekR

I think the easiest way would be to implement onerror... This event is fired outside of the Serviceworker and catch all unhandled Exception.

https://developer.mozilla.org/de/docs/Web/API/ServiceWorkerContainer/onerror

rriverak avatar Apr 26 '17 15:04 rriverak

@likebrain Probably. Need to test if it's actually useful. In a meantime, you can assign a listener to it yourself in your code and on onUpdateFailed use the last error from it.

NekR avatar May 05 '17 18:05 NekR