THRIFT-5373 HTTP status in case of Protocol/Transport exceptions

Client: netstd
Patch: Jens Geyer
This commit is contained in:
Jens Geyer 2021-03-18 16:50:39 +01:00
parent 2dcefadba8
commit cd2fae091b

View File

@ -116,7 +116,12 @@ namespace Thrift.Transport.Server
catch (TTransportException)
{
if (!context.Response.HasStarted) // if something goes bust, let the client know
context.Response.StatusCode = 500;
context.Response.StatusCode = 500; // internal server error
}
catch (TProtocolException)
{
if (!context.Response.HasStarted) // if something goes bust, let the client know
context.Response.StatusCode = 400; // bad request, e.g. required field missing
}
finally
{