Commit 25525323 authored by Philippe Pepiot's avatar Philippe Pepiot
Browse files

Fix RequestError has no attribute "reason"

Only RemoteCallFailed has an attribute called "reason", which is also the
message of the exception.

Use str() to have a compatible way to get the error message.
parent cf75cf92b4f4
......@@ -389,7 +389,7 @@ def cubicweb_requesterror(exc, request):
if request.cw_cnx is not None:
return json_problem(status=int(exc.status), detail=exc.reason)
return json_problem(status=int(exc.status), detail=str(exc))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment