mirror of
https://github.com/EpinelPS/EpinelPS.git
synced 2025-12-12 15:04:36 +01:00
fix error handling
This commit is contained in:
@@ -5,6 +5,7 @@ using EpinelPS.LobbyServer.Msgs.Stage;
|
|||||||
using EpinelPS.StaticInfo;
|
using EpinelPS.StaticInfo;
|
||||||
using EpinelPS.Utils;
|
using EpinelPS.Utils;
|
||||||
using Google.Api;
|
using Google.Api;
|
||||||
|
using Microsoft.AspNetCore.Server.Kestrel.Core;
|
||||||
using Microsoft.AspNetCore.Server.Kestrel.Https;
|
using Microsoft.AspNetCore.Server.Kestrel.Https;
|
||||||
using Microsoft.Extensions.Logging.EventLog;
|
using Microsoft.Extensions.Logging.EventLog;
|
||||||
using Microsoft.VisualBasic;
|
using Microsoft.VisualBasic;
|
||||||
@@ -49,6 +50,7 @@ namespace EpinelPS
|
|||||||
serverOptions.Listen(IPAddress.Any, 443,
|
serverOptions.Listen(IPAddress.Any, 443,
|
||||||
listenOptions =>
|
listenOptions =>
|
||||||
{
|
{
|
||||||
|
listenOptions.Protocols = HttpProtocols.Http1AndHttp2AndHttp3;
|
||||||
listenOptions.UseHttps(AppDomain.CurrentDomain.BaseDirectory + @"site.pfx", "");
|
listenOptions.UseHttps(AppDomain.CurrentDomain.BaseDirectory + @"site.pfx", "");
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -766,15 +768,17 @@ namespace EpinelPS
|
|||||||
response.AddRange([.. ResponseWithBytes]);
|
response.AddRange([.. ResponseWithBytes]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch
|
catch(Exception ex)
|
||||||
{
|
{
|
||||||
List<byte> ResponseWithBytes =
|
List<byte> ResponseWithBytes =
|
||||||
[ .. Encoding.UTF8.GetBytes("HTTP/1.1 505 Internal Server Error\r\n"),
|
[ .. Encoding.UTF8.GetBytes("HTTP/1.1 500 Internal Server Error\r\n"),
|
||||||
//.. Encoding.UTF8.GetBytes($"Content-Type: application/octet-stream+protobuf\r\n"),
|
//.. Encoding.UTF8.GetBytes($"Content-Type: application/octet-stream+protobuf\r\n"),
|
||||||
.. Encoding.UTF8.GetBytes($"Content-Length: 0\r\n"),
|
.. Encoding.UTF8.GetBytes($"Content-Length: 0\r\n"),
|
||||||
.. Encoding.UTF8.GetBytes($"\r\n"),
|
.. Encoding.UTF8.GetBytes($"\r\n"),
|
||||||
];
|
];
|
||||||
response.AddRange([.. ResponseWithBytes]);
|
response.AddRange([.. ResponseWithBytes]);
|
||||||
|
|
||||||
|
Console.WriteLine("Exception during batch request: " + ex.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
// add boundary, also include http newline if there is binary content
|
// add boundary, also include http newline if there is binary content
|
||||||
|
|||||||
Reference in New Issue
Block a user