This makes a ProviderException(400, ..) actually send a 400 status code, and display the correct message. Otherwise, we were sending an error 500, because cherrypy did not know how to interpret Exception's rather than cherrypy.HTTPError.
Signed-off-by: Patrick Uiterwijk puiterwijk@redhat.com
rebased
Seems a little odd to me that you override self.code. I would have expected more something along the lines of: super(ProviderException, self).__init__(code or self.code, self.message)
self.code
super(ProviderException, self).__init__(code or self.code, self.message)
Or (above in the code):
if not code: code = self.code
Cool, :thumbsup: for me
Pull-Request has been merged by puiterwijk
+1
This makes a ProviderException(400, ..) actually send a 400 status code,
and display the correct message.
Otherwise, we were sending an error 500, because cherrypy did not
know how to interpret Exception's rather than cherrypy.HTTPError.
Signed-off-by: Patrick Uiterwijk puiterwijk@redhat.com