Make rest_client exception inheritances easy

There are rest_client own exceptions, but some of these inheritances
are not reasonable. Then, tempest-lib users(like Tempest) can not know
what exceptions happen when using rest_client module of tempest-lib.
This patch makes them easy.

Change-Id: Iba5108eb39b76153326020d2281f8f99ddf1bec6
This commit is contained in:
Ken'ichi Ohmichi
2015-01-19 01:56:45 +00:00
parent 26828ccc9e
commit ebd5ed69fc

View File

@@ -50,10 +50,6 @@ class RestClientException(TempestException,
pass pass
class RFCViolation(RestClientException):
message = "RFC Violation"
class InvalidHttpSuccessCode(RestClientException): class InvalidHttpSuccessCode(RestClientException):
message = "The success code is different than the expected one" message = "The success code is different than the expected one"
@@ -66,7 +62,7 @@ class Unauthorized(RestClientException):
message = 'Unauthorized' message = 'Unauthorized'
class TimeoutException(TempestException): class TimeoutException(RestClientException):
message = "Request timed out" message = "Request timed out"
@@ -98,12 +94,12 @@ class Conflict(RestClientException):
message = "An object with that identifier already exists" message = "An object with that identifier already exists"
class ResponseWithNonEmptyBody(RFCViolation): class ResponseWithNonEmptyBody(RestClientException):
message = ("RFC Violation! Response with %(status)d HTTP Status Code " message = ("RFC Violation! Response with %(status)d HTTP Status Code "
"MUST NOT have a body") "MUST NOT have a body")
class ResponseWithEntity(RFCViolation): class ResponseWithEntity(RestClientException):
message = ("RFC Violation! Response with 205 HTTP Status Code " message = ("RFC Violation! Response with 205 HTTP Status Code "
"MUST NOT have an entity") "MUST NOT have an entity")