Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error reporting enhancements (conditional-raise-instead-of-assert version) #80

Conversation

chrysn
Copy link
Contributor

@chrysn chrysn commented Nov 29, 2016

See comment on #66.

a TaskException already wraps another exception; raising it gives a
hard-to-read multi-line message instead of showing the clean wrapped
original backtrace; for comparison, an asserton error in image.py line
253:

exception AssertionError at /home/chrysn/git/whipper/morituri/image/image.py:253: stop(): Track length was not found; look for earlier errors in debug log (set RIP_DEBUG=4)
Traceback (most recent call last):
  File "/home/chrysn/git/whipper/morituri/extern/task/task.py", line 497, in _startWrap
    task.start(self)
  File "/home/chrysn/git/whipper/morituri/extern/task/task.py", line 395, in start
    BaseMultiTask.start(self, runner)
  File "/home/chrysn/git/whipper/morituri/extern/task/task.py", line 330, in start
    self.next()
  File "/home/chrysn/git/whipper/morituri/extern/task/task.py", line 401, in next
    BaseMultiTask.next(self)
  File "/home/chrysn/git/whipper/morituri/extern/task/task.py", line 351, in next
    self.stop()
  File "/home/chrysn/git/whipper/morituri/image/image.py", line 253, in stop
    assert taskk.length is not None, "Track length was not found; look for earlier errors in debug log (set RIP_DEBUG=4)"
AssertionError: Track length was not found; look for earlier errors in debug log (set RIP_DEBUG=4)

vs.

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/chrysn/git/whipper/morituri/rip/main.py", line 27, in main
    ret = c.parse(sys.argv[1:])
  File "/home/chrysn/git/whipper/morituri/rip/main.py", line 94, in parse
    logcommand.LogCommand.parse(self, argv)
  File "/home/chrysn/git/whipper/morituri/common/logcommand.py", line 62, in parse
    command.Command.parse(self, argv)
  File "/home/chrysn/git/whipper/morituri/extern/command/command.py", line 401, in parse
    return self.subCommands[command].parse(args[1:])
  File "/home/chrysn/git/whipper/morituri/common/logcommand.py", line 62, in parse
    command.Command.parse(self, argv)
  File "/home/chrysn/git/whipper/morituri/extern/command/command.py", line 401, in parse
    return self.subCommands[command].parse(args[1:])
  File "/home/chrysn/git/whipper/morituri/common/logcommand.py", line 62, in parse
    command.Command.parse(self, argv)
  File "/home/chrysn/git/whipper/morituri/extern/command/command.py", line 363, in parse
    ret = self.do(args)
  File "/home/chrysn/git/whipper/morituri/rip/image.py", line 184, in do
    cueImage.setup(runner)
  File "/home/chrysn/git/whipper/morituri/image/image.py", line 75, in setup
    runner.run(verify)
  File "/home/chrysn/git/whipper/morituri/extern/task/task.py", line 490, in run
    raise TaskException(task.exception, message=msg)
morituri.extern.task.task.TaskException: (AssertionError('Track length was not found; look for earlier errors in debug log (set RIP_DEBUG=4)',), 'exception AssertionError at /home/chrysn/git/whipper/morituri/image/image.py:253: stop(): Track length was not found; look for earlier errors in debug log (set RIP_DEBUG=4)\nTraceback (most recent call last):\n  File "/home/chrysn/git/whipper/morituri/extern/task/task.py", line 497, in _startWrap\n    task.start(self)\n  File "/home/chrysn/git/whipper/morituri/extern/task/task.py", line 395, in start\n    BaseMultiTask.start(self, runner)\n  File "/home/chrysn/git/whipper/morituri/extern/task/task.py", line 330, in start\n    self.next()\n  File "/home/chrysn/git/whipper/morituri/extern/task/task.py", line 401, in next\n    BaseMultiTask.next(self)\n  File "/home/chrysn/git/whipper/morituri/extern/task/task.py", line 351, in next\n    self.stop()\n  File "/home/chrysn/git/whipper/morituri/image/image.py", line 253, in stop\n    assert taskk.length is not None, "Track length was not found; look for earlier errors in debug log (set RIP_DEBUG=4)"\nAssertionError: Track length was not found; look for earlier errors in debug log (set RIP_DEBUG=4)\n')
@RecursiveForest
Copy link
Contributor

ACK. I have a WIP branch in my repo for replacing the python-command stuff with argparse (which is done), but at the same time it has to overhaul the logging system (because they're intricately tied together in morituri…), which is not done. I think I've already incorporated the equivalent of the rip.main change, but certainly not the taskk.length check.

@RecursiveForest RecursiveForest merged commit d455b77 into whipper-team:master Dec 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants