mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Added HTTP Header 'X-Description' to API error responses.
For easy access to API error descriptions in the CloudBridge.
This commit is contained in:
parent
a013640180
commit
ee923e5797
@ -267,6 +267,7 @@ public class ApiServlet extends HttpServlet {
|
||||
writeResponse(resp, response != null ? response : "", HttpServletResponse.SC_OK, responseType);
|
||||
} catch (ServerApiException se) {
|
||||
String serializedResponseText = _apiServer.getSerializedApiError(se.getErrorCode(), se.getDescription(), params, responseType);
|
||||
resp.setHeader("X-Description", se.getDescription());
|
||||
writeResponse(resp, serializedResponseText, se.getErrorCode(), responseType);
|
||||
auditTrailSb.append(" " +se.getErrorCode() + " " + se.getDescription());
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user