StackExchange.Metrics icon indicating copy to clipboard operation
StackExchange.Metrics copied to clipboard

Don't throw on connection failure if ThrowOnPostFail is false

Open bretcope opened this issue 9 years ago • 2 comments

Right now, ThrowOnPostFail only applies to >= 500 status codes, but it should also apply if the connection is unavailable.

bretcope avatar Jul 25 '16 19:07 bretcope

Looking at the code, you can set a handler which will stop it from throwing.

MetricsCollector.OnBackgroundException +=

wilson85 avatar Jan 12 '17 11:01 wilson85

@wilson85 those are orthogonal. The background exception handler catches anything that throws and sends it somewhere that won't crash the background thread (and potentially the process). The ThrowOnPostFails deals with whether an exception gets sent anywhere (regardless of whether it's truly thrown or sent to the exception handler).

It should probably be renamed to TreatPostFailAsError or something like that in the future to make it less confusing.

bretcope avatar Jan 15 '17 22:01 bretcope