Page MenuHomeDevCentral

Extract Python error from an exception with traceback
ClosedPublic

Authored by dereckson on May 13 2017, 11:41.
Tags
None
Referenced Files
F45508753: D984.id2515.diff
Sat, Aug 22, 11:48
F45491281: D984.id2594.diff
Sat, Aug 22, 10:12
F45491277: D984.id2515.diff
Sat, Aug 22, 10:12
F45480700: D984.diff
Sat, Aug 22, 09:17
Unknown Object (File)
Thu, Aug 20, 12:12
Unknown Object (File)
Mon, Aug 17, 11:38
Unknown Object (File)
Mon, Aug 17, 11:34
Unknown Object (File)
Sun, Aug 16, 12:15
Subscribers

Details

Summary

.+surname and .+givenname can sometimes fail with a
pywikibot.data.api.APIError thrown.

If we were in a pure Python context we could nicely catch
those errors.

Currently, from our TCL interpreter, we instead receive a text output.

A callback method is provided to parse this output to print error.

Fixes T1203.

Test Plan

With a test_exception raising a TypeError containing the text of the actual error
(so we can be sure we catch the REAL exception, not an embedded text looking like an exception):
run_command "python /home/surfboard/bin/test_exception" print_command_callback print_python_error_callback {dcc 14}
run_command "python /home/surfboard/bin/test_exception" print_command_callback print_python_error_callback {quick #pentacle}

Diff Detail

Repository
rVIPER ViperServ scripts
Lint
No Lint Coverage
Unit
No Test Coverage
Branch
print_python_error_callback (branched from master)
Build Status
Buildable 1530
Build 1778: arc lint + arc unit