Mercurial > hg > orthanc
changeset 333:c730f6e42848
robustify
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 09 Jan 2013 15:40:10 +0100 |
parents | c51c9ed603e6 |
children | ae0818659d50 |
files | Core/HttpServer/MongooseServer.cpp |
diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/Core/HttpServer/MongooseServer.cpp Wed Jan 09 13:57:58 2013 +0100 +++ b/Core/HttpServer/MongooseServer.cpp Wed Jan 09 15:40:10 2013 +0100 @@ -554,7 +554,12 @@ catch (boost::bad_lexical_cast&) { LOG(ERROR) << "MongooseServer Exception: Bad lexical cast"; - output.SendHeader(Orthanc_HttpStatus_500_InternalServerError); + output.SendHeader(Orthanc_HttpStatus_400_BadRequest); + } + catch (std::runtime_error&) + { + LOG(ERROR) << "MongooseServer Exception: Presumably a bad JSON request"; + output.SendHeader(Orthanc_HttpStatus_400_BadRequest); } } else