summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2015-05-28 10:37:10 -0400
committerSimo Sorce <simo@redhat.com>2015-05-28 10:38:37 -0400
commit3319d29beb9a6c7f414ef535d1cfb151f576c5f1 (patch)
tree332fe61d4326439853e666dcd867209ab1caa342
parenteaef79904119b87c696c3f7609b708bebd2dcdb5 (diff)
downloadcustodia-3319d29beb9a6c7f414ef535d1cfb151f576c5f1.tar.gz
custodia-3319d29beb9a6c7f414ef535d1cfb151f576c5f1.tar.xz
custodia-3319d29beb9a6c7f414ef535d1cfb151f576c5f1.zip
Use str to give back more human readable messages
These messages are returned as is by the HTTP server as the status code reason, str() returns a more human readable format. Signed-off-by: Simo Sorce <simo@redhat.com>
-rw-r--r--custodia/message/kem.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/custodia/message/kem.py b/custodia/message/kem.py
index 34b3763..9d58420 100644
--- a/custodia/message/kem.py
+++ b/custodia/message/kem.py
@@ -114,7 +114,7 @@ class KEMHandler(MessageHandler):
try:
jtok = JWT(jwt=msg)
except Exception as e:
- raise InvalidMessage('Failed to parse message: %s' % repr(e))
+ raise InvalidMessage('Failed to parse message: %s' % str(e))
try:
token = jtok.token
@@ -136,7 +136,7 @@ class KEMHandler(MessageHandler):
else:
raise TypeError("Invalid Token type: %s" % type(jtok))
except Exception as e:
- raise InvalidMessage('Failed to validate message: %s' % repr(e))
+ raise InvalidMessage('Failed to validate message: %s' % str(e))
# FIXME: check name/time