197 excinfo = req.data.get('excinfo') |
197 excinfo = req.data.get('excinfo') |
198 title = _('an error occured') |
198 title = _('an error occured') |
199 self.w(u'<h2>%s</h2>' % title) |
199 self.w(u'<h2>%s</h2>' % title) |
200 if 'errmsg' in req.data: |
200 if 'errmsg' in req.data: |
201 ex = req.data['errmsg'] |
201 ex = req.data['errmsg'] |
202 else: |
202 exclass = None |
|
203 else: |
|
204 exclass = ex.__class__.__name__ |
203 ex = exc_message(ex, req.encoding) |
205 ex = exc_message(ex, req.encoding) |
204 if excinfo is not None and self.config['print-traceback']: |
206 if excinfo is not None and self.config['print-traceback']: |
205 exclass = ex.__class__.__name__ |
207 if exclass is None: |
206 self.w(u'<div class="tb">%s: %s</div>' % (exclass, html_escape(ex).replace("\n","<br />"))) |
208 self.w(u'<div class="tb">%s</div>' |
|
209 % html_escape(ex).replace("\n","<br />")) |
|
210 else: |
|
211 self.w(u'<div class="tb">%s: %s</div>' |
|
212 % (exclass, html_escape(ex).replace("\n","<br />"))) |
207 self.w(u'<hr />') |
213 self.w(u'<hr />') |
208 self.w(u'<div class="tb">%s</div>' % html_traceback(excinfo, ex, '')) |
214 self.w(u'<div class="tb">%s</div>' % html_traceback(excinfo, ex, '')) |
209 else: |
215 else: |
210 self.w(u'<div class="tb">%s</div>' % (html_escape(ex).replace("\n","<br />"))) |
216 self.w(u'<div class="tb">%s</div>' % (html_escape(ex).replace("\n","<br />"))) |
211 # if excinfo is not None, it's probably not a bug |
217 # if excinfo is not None, it's probably not a bug |