Catch exception on shutdown
This commit is contained in:
parent
09fa3b8734
commit
a2a70e8339
|
|
@ -46,6 +46,7 @@ public sealed class HttpServer {
|
||||||
try {
|
try {
|
||||||
var ctx = await listener.GetContextAsync();
|
var ctx = await listener.GetContextAsync();
|
||||||
_ = ProcessRequestAsync(ctx);
|
_ = ProcessRequestAsync(ctx);
|
||||||
|
} catch (HttpListenerException ex) when (ex.ErrorCode == 995) { //The I/O operation has been aborted because of either a thread exit or an application request
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
logger.Fatal($"Caught otherwise uncaught exception in GetContextLoop:\n{ex}");
|
logger.Fatal($"Caught otherwise uncaught exception in GetContextLoop:\n{ex}");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user