diff options
author | Rob Austein <sra@hactrn.net> | 2009-07-04 20:13:22 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2009-07-04 20:13:22 +0000 |
commit | 6462e03109be39a7e6e82ba5c49874d4652b5810 (patch) | |
tree | a1154f496b34145a4ac0797505f6619727af3fb2 /rpkid/rpki/publication.py | |
parent | 6baa092a44b6ae9d1ffddc8fc6928c9bbb368124 (diff) |
Clean up and consolidate traceback. Add methods to hide (some of the)
mucking about with msg.type variables. Include query PDU tags in
reply <report_error/> PDUs.
svn path=/rpkid/irbe-setup.py; revision=2571
Diffstat (limited to 'rpkid/rpki/publication.py')
-rw-r--r-- | rpkid/rpki/publication.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/rpkid/rpki/publication.py b/rpkid/rpki/publication.py index 8130f78c..dc033d31 100644 --- a/rpkid/rpki/publication.py +++ b/rpkid/rpki/publication.py @@ -32,7 +32,7 @@ OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. """ -import base64, os, traceback +import base64, os import rpki.resource_set, rpki.x509, rpki.sql, rpki.exceptions, rpki.xml_utils import rpki.https, rpki.up_down, rpki.relaxng, rpki.sundial, rpki.log, rpki.roa @@ -288,11 +288,12 @@ class report_error_elt(rpki.xml_utils.base_elt, publication_namespace): attributes = ("tag", "error_code") @classmethod - def from_exception(cls, exc): + def from_exception(cls, exc, tag = None): """ Generate a <report_error/> element from an exception. """ self = cls() + self.tag = tag self.error_code = exc.__class__.__name__ return self @@ -322,8 +323,8 @@ class msg(rpki.xml_utils.msg, publication_namespace): def loop(iterator, q_pdu): def fail(e): - rpki.log.error(traceback.format_exc()) - r_msg.append(report_error_elt.from_exception(e)) + rpki.log.traceback() + r_msg.append(report_error_elt.from_exception(e, q_pdu.tag)) cb(r_msg) try: |