equal
deleted
inserted
replaced
22 |
22 |
23 from logilab.mtconverter import xml_escape |
23 from logilab.mtconverter import xml_escape |
24 |
24 |
25 from cubicweb.selectors import yes, none_rset, match_user_groups, authenticated_user |
25 from cubicweb.selectors import yes, none_rset, match_user_groups, authenticated_user |
26 from cubicweb.view import AnyRsetView, StartupView, EntityView, View |
26 from cubicweb.view import AnyRsetView, StartupView, EntityView, View |
27 from cubicweb.uilib import html_traceback, rest_traceback |
27 from cubicweb.uilib import html_traceback, rest_traceback, exc_message |
28 from cubicweb.web import formwidgets as wdgs |
28 from cubicweb.web import formwidgets as wdgs |
29 from cubicweb.web.formfields import guess_field |
29 from cubicweb.web.formfields import guess_field |
30 from cubicweb.web.views.schema import SecurityViewMixIn |
30 from cubicweb.web.views.schema import SecurityViewMixIn |
31 |
31 |
32 from yams.buildobjs import EntityType |
32 from yams.buildobjs import EntityType |
218 form.form_buttons = [wdgs.SubmitButton(MAIL_SUBMIT_MSGID)] |
218 form.form_buttons = [wdgs.SubmitButton(MAIL_SUBMIT_MSGID)] |
219 form.action = req.build_url('reportbug') |
219 form.action = req.build_url('reportbug') |
220 form.render(w=w) |
220 form.render(w=w) |
221 |
221 |
222 |
222 |
223 def exc_message(ex, encoding): |
|
224 try: |
|
225 return unicode(ex) |
|
226 except: |
|
227 try: |
|
228 return unicode(str(ex), encoding, 'replace') |
|
229 except: |
|
230 return unicode(repr(ex), encoding, 'replace') |
|
231 |
|
232 def text_error_description(ex, excinfo, req, eversion, cubes): |
223 def text_error_description(ex, excinfo, req, eversion, cubes): |
233 binfo = rest_traceback(excinfo, xml_escape(ex)) |
224 binfo = rest_traceback(excinfo, xml_escape(ex)) |
234 binfo += u'\n\n:URL: %s\n' % req.url() |
225 binfo += u'\n\n:URL: %s\n' % req.url() |
235 if not '__bugreporting' in req.form: |
226 if not '__bugreporting' in req.form: |
236 binfo += u'\n:form params:\n' |
227 binfo += u'\n:form params:\n' |