Closed lockie closed 8 years ago
Ah, I see.
The only issue is, this kind of flies in the face of JSend. In this case, if debug is turned off, message
is in fact None
, which makes it useless and not "A meaningful, end-user-readable (or at the least log-worthy) message, explaining what went wrong." as described in the JSend spec.
I would consider doing something like this though:
- message=self._reason,
- data=get_exc_message(exception) if self.settings.get("debug")
- else None
+ message="{}{}".format(self._reason, "; {}".format(get_exc_message(exception)) if self.settings.get("debug") else "")
This way the whole error is contained in message
, which makes a lot of sense to me. On the client side, it's simply a matter of checking message
if the status
is error
which really shouldn't be that hard to do.
This way the whole error is contained in
message
, which makes a lot of sense to me.
You're right, it does to me to. But then again, there's issue with expected exceptions :) I'll describe it in #76.
Oops, broke it. Sorry.
See #76