comparison Core/RestApi/RestApiOutput.cpp @ 1582:bd1889029cbb

encoding of exceptions
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 25 Aug 2015 17:39:38 +0200
parents 9c5d93510414
children b1291df2f780
comparison
equal deleted inserted replaced
1581:357c4bb15701 1582:bd1889029cbb
142 if (status != HttpStatus_400_BadRequest && 142 if (status != HttpStatus_400_BadRequest &&
143 status != HttpStatus_403_Forbidden && 143 status != HttpStatus_403_Forbidden &&
144 status != HttpStatus_500_InternalServerError && 144 status != HttpStatus_500_InternalServerError &&
145 status != HttpStatus_415_UnsupportedMediaType) 145 status != HttpStatus_415_UnsupportedMediaType)
146 { 146 {
147 throw OrthancException("This HTTP status is not allowed in a REST API"); 147 throw OrthancException(ErrorCode_BadHttpStatusInRest);
148 } 148 }
149 149
150 CheckStatus(); 150 CheckStatus();
151 output_.SendStatus(status, message, messageSize); 151 output_.SendStatus(status, message, messageSize);
152 alreadySent_ = true; 152 alreadySent_ = true;