()
| 341 | from_address = from_address or to_address |
| 342 | |
| 343 | def emailerrors_internal(): |
| 344 | error = olderror() |
| 345 | tb = sys.exc_info() |
| 346 | error_name = tb[0] |
| 347 | error_value = tb[1] |
| 348 | tb_txt = "".join(traceback.format_exception(*tb)) |
| 349 | path = web.ctx.path |
| 350 | request = web.ctx.method + " " + web.ctx.home + web.ctx.fullpath |
| 351 | |
| 352 | message = f"\n{request}\n\n{tb_txt}\n\n" |
| 353 | |
| 354 | sendmail( |
| 355 | "your buggy site <%s>" % from_address, |
| 356 | "the bugfixer <%s>" % to_address, |
| 357 | "bug: {error_name}: {error_value} ({path})".format(**locals()), |
| 358 | message, |
| 359 | attachments=[dict(filename="bug.html", content=safestr(djangoerror()))], |
| 360 | ) |
| 361 | return error |
| 362 | |
| 363 | return emailerrors_internal |
| 364 |
nothing calls this directly
no test coverage detected