diff options
author | Rob Austein <sra@hactrn.net> | 2009-05-05 03:25:35 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2009-05-05 03:25:35 +0000 |
commit | 2053fd91e25f06997f39c6271a5397358d9b853d (patch) | |
tree | bcdda5ad271540aca164c0daab0eb43f5d0db605 | |
parent | 4110a31d0189db7b9a97d6eeaba0bf03b6877a3e (diff) |
Don't print backtraces unless debugging
svn path=/rpkid/testpoke.py; revision=2402
-rw-r--r-- | rpkid/testpoke.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/rpkid/testpoke.py b/rpkid/testpoke.py index 78191efb..f28dc9b2 100644 --- a/rpkid/testpoke.py +++ b/rpkid/testpoke.py @@ -100,7 +100,12 @@ def query_up_down(q_pdu): def done(der): r_msg, r_xml = rpki.up_down.cms_msg.unwrap(der, [cms_ta] + cms_ca_certs, pretty_print = True) print r_xml - r_msg.payload.check_response() + try: + r_msg.payload.check_response() + except Exception, edata: + if debug: + raise + print "Failed:", edata rpki.async.exit_event_loop() rpki.https.client( @@ -144,5 +149,10 @@ https_cert = get_PEM("ssl-cert", rpki.x509.X509) https_certs = get_PEM_chain("ssl-cert-chain", https_cert) https_ca_certs = get_PEM_chain("ssl-ca-certs") -dispatch[yaml_req["type"]]() -rpki.async.event_loop() +try: + dispatch[yaml_req["type"]]() + rpki.async.event_loop() +except Exception, edata: + if debug: + raise + print "Failed:", edata |