Skip to content

Commit ee923e5

Browse files
Added HTTP Header 'X-Description' to API error responses.
For easy access to API error descriptions in the CloudBridge.
1 parent a013640 commit ee923e5

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎server/src/com/cloud/api/ApiServlet.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ private void processRequest(HttpServletRequest req, HttpServletResponse resp) {
267267
writeResponse(resp, response != null ? response : "", HttpServletResponse.SC_OK, responseType);
268268
} catch (ServerApiException se) {
269269
String serializedResponseText = _apiServer.getSerializedApiError(se.getErrorCode(), se.getDescription(), params, responseType);
270+
resp.setHeader("X-Description", se.getDescription());
270271
writeResponse(resp, serializedResponseText, se.getErrorCode(), responseType);
271272
auditTrailSb.append(" " +se.getErrorCode() + " " + se.getDescription());
272273
}

0 commit comments

Comments
 (0)