mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-06 18:35:19 +00:00
THRIFT-5373 HTTP status in case of Protocol/Transport exceptions
Client: netstd Patch: Jens Geyer
This commit is contained in:
parent
2dcefadba8
commit
cd2fae091b
@ -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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user