serilog-sinks-browserhttp icon indicating copy to clipboard operation
serilog-sinks-browserhttp copied to clipboard

Unhandled exception breaks offline PWA

Open jashmore opened this issue 4 years ago • 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.

jashmore avatar May 13 '21 14:05 jashmore

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

nblumhardt avatar May 13 '21 22:05 nblumhardt