Show More
@@ -26,6 +26,7 b' import logging' | |||||
26 | import traceback |
|
26 | import traceback | |
27 | import tempfile |
|
27 | import tempfile | |
28 |
|
28 | |||
|
29 | from pyramid import compat | |||
29 |
|
30 | |||
30 | log = logging.getLogger(__name__) |
|
31 | log = logging.getLogger(__name__) | |
31 |
|
32 | |||
@@ -69,9 +70,26 b' def get_exc_store():' | |||||
69 |
|
70 | |||
70 | def _store_exception(exc_id, exc_info, prefix): |
|
71 | def _store_exception(exc_id, exc_info, prefix): | |
71 | exc_type, exc_value, exc_traceback = exc_info |
|
72 | exc_type, exc_value, exc_traceback = exc_info | |
|
73 | ||||
72 | tb = ''.join(traceback.format_exception( |
|
74 | tb = ''.join(traceback.format_exception( | |
73 | exc_type, exc_value, exc_traceback, None)) |
|
75 | exc_type, exc_value, exc_traceback, None)) | |
74 |
|
76 | |||
|
77 | detailed_tb = getattr(exc_value, '_org_exc_tb', None) | |||
|
78 | ||||
|
79 | if detailed_tb: | |||
|
80 | if isinstance(detailed_tb, compat.string_types): | |||
|
81 | remote_tb = [detailed_tb] | |||
|
82 | ||||
|
83 | tb += ( | |||
|
84 | '\n+++ BEG SOURCE EXCEPTION +++\n\n' | |||
|
85 | '{}\n' | |||
|
86 | '+++ END SOURCE EXCEPTION +++\n' | |||
|
87 | ''.format('\n'.join(remote_tb)) | |||
|
88 | ) | |||
|
89 | ||||
|
90 | # Avoid that remote_tb also appears in the frame | |||
|
91 | del remote_tb | |||
|
92 | ||||
75 | exc_type_name = exc_type.__name__ |
|
93 | exc_type_name = exc_type.__name__ | |
76 | exc_store_path = get_exc_store() |
|
94 | exc_store_path = get_exc_store() | |
77 | exc_data, org_data = exc_serialize(exc_id, tb, exc_type_name) |
|
95 | exc_data, org_data = exc_serialize(exc_id, tb, exc_type_name) |
General Comments 0
You need to be logged in to leave comments.
Login now