nblumhardt/serilog-sinks-browserhttp

Unhandled exception breaks offline PWA

jashmore opened this issue · 1 comments

We have a Blazor app which is designed to be used offline under certain circumstances. The BrowserHttpSink.EmitBatchAsync method is not exception safe, so when it is offline, the call to _httpClient.PostAsync throws an unhandled exception which breaks the app.

Thanks for the heads-up 👍 - not sure where/how the problem will be, the base PeriodicBatchingSink should be catching and suppressing these:

https://github.com/serilog/serilog-sinks-periodicbatching/blob/dev/src/Serilog.Sinks.PeriodicBatching/Sinks/PeriodicBatching/PeriodicBatchingSink.cs#L229

Investigation help/PRs welcome, if anyone has time to check it out