Revision 352e1a26
b/lib/errors.py | ||
---|---|---|
429 | 429 |
str(inner)] |
430 | 430 |
|
431 | 431 |
|
432 |
class RapiTestResult(GenericError): |
|
433 |
"""Exception containing results from RAPI test utilities. |
|
434 |
|
|
435 |
""" |
|
436 |
|
|
437 |
|
|
432 | 438 |
# errors should be added above |
433 | 439 |
|
434 | 440 |
|
b/lib/http/server.py | ||
---|---|---|
35 | 35 |
from ganeti import utils |
36 | 36 |
from ganeti import netutils |
37 | 37 |
from ganeti import compat |
38 |
from ganeti import errors |
|
38 | 39 |
|
39 | 40 |
|
40 | 41 |
WEEKDAYNAME = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"] |
... | ... | |
233 | 234 |
|
234 | 235 |
# Call actual request handler |
235 | 236 |
result = handler.HandleRequest(handler_context) |
236 |
except (http.HttpException, KeyboardInterrupt, SystemExit): |
|
237 |
except (http.HttpException, errors.RapiTestResult, |
|
238 |
KeyboardInterrupt, SystemExit): |
|
237 | 239 |
raise |
238 | 240 |
except Exception, err: |
239 | 241 |
logging.exception("Caught exception") |
b/lib/server/rapi.py | ||
---|---|---|
194 | 194 |
raise http.HttpGatewayTimeout() |
195 | 195 |
except luxi.ProtocolError, err: |
196 | 196 |
raise http.HttpBadGateway(str(err)) |
197 |
except: |
|
198 |
method = req.request_method.upper() |
|
199 |
logging.exception("Error while handling the %s request", method) |
|
200 |
raise |
|
201 | 197 |
|
202 | 198 |
req.resp_headers[http.HTTP_CONTENT_TYPE] = http.HTTP_APP_JSON |
203 | 199 |
|
Also available in: Unified diff