Catch exception on shutdown
This commit is contained in:
@@ -46,6 +46,7 @@ public sealed class HttpServer {
|
||||
try {
|
||||
var ctx = await listener.GetContextAsync();
|
||||
_ = 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) {
|
||||
logger.Fatal($"Caught otherwise uncaught exception in GetContextLoop:\n{ex}");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user