Merge "Use 406 error instead of 500 error when Service API is not supported"
This commit is contained in:
commit
47574ead00
|
@ -43,7 +43,8 @@ class ServicesController(rest.RestController):
|
|||
LOG.debug("Fetch services.")
|
||||
|
||||
if not cfg.CONF.coordination.backend_url:
|
||||
raise exc.CoordinationException("Service API is not supported.")
|
||||
raise exc.CoordinationNotSupportedException("Service API "
|
||||
"is not supported.")
|
||||
|
||||
service_coordinator = coordination.get_service_coordinator()
|
||||
|
||||
|
|
|
@ -176,6 +176,10 @@ class CoordinationException(MistralException):
|
|||
http_code = 500
|
||||
|
||||
|
||||
class CoordinationNotSupportedException(MistralException):
|
||||
http_code = 406
|
||||
|
||||
|
||||
class NotAllowedException(MistralException):
|
||||
http_code = 403
|
||||
message = "Operation forbidden (insufficient permissions)"
|
||||
|
|
Loading…
Reference in New Issue