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

exceptions when rendering template need better debug output #23

Closed
aspiers opened this issue May 21, 2013 · 4 comments
Closed

exceptions when rendering template need better debug output #23

aspiers opened this issue May 21, 2013 · 4 comments

Comments

@aspiers
Copy link

aspiers commented May 21, 2013

See #6 for an example TypeError failure with useless debug output.

I'm not sure there's any way to get better debug without using a different thread handling mechanism. AFAICS the TypeError comes from rendering the template but I don't think it gets decorated with the number of the offending line in the template, and the stack trace resulting from #20 is in the context of the re-raise by futures.Future, not within the thread where it was originally raised. ICBW though - need to investigate further ...

@aspiers
Copy link
Author

aspiers commented May 21, 2013

Here's another example of a useless stack trace:

Failed plugin bugzilla:bnc:
Traceback (most recent call last):
  File "/home/adam/.GIT/3rd-party/rapport/rapport/report.py", line 93, in create_report
    results[plugin] = tmpl.render(future.result())
  File "/usr/lib/python2.7/site-packages/concurrent/futures/_base.py", line 397, in result
    return self.__get_result()
  File "/usr/lib/python2.7/site-packages/concurrent/futures/_base.py", line 356, in __get_result
    raise self._exception
ProtocolError: <ProtocolError for apibugzilla.novell.com/xmlrpc.cgi: 401 Authorization Required>

so it's not just TypeErrors.

@mvidner
Copy link
Contributor

mvidner commented Jul 18, 2013

I was hit by this too:

Failed plugin bugzilla:bnc: global name 'url' is not defined!
Traceback (most recent call last):
  File "/home/mvidner/svn/rapport/rapport/report.py", line 91, in create_report
    results[plugin] = tmpl.render(future.result())
  File "/usr/lib/python2.7/site-packages/concurrent/futures/_base.py", line 397, in result
    return self.__get_result()
  File "/usr/lib/python2.7/site-packages/concurrent/futures/_base.py", line 356, in __get_result
    raise self._exception
NameError: global name 'url' is not defined

The original backtrace (er, "traceback") is lost which is apparently the fault of the futures library. I'll try to add an option to disable the threading and hope that will make the exceptions clearer.

@mvidner
Copy link
Contributor

mvidner commented Jul 18, 2013

I have a very crude and dirty hack for this: mvidner@7f30228.

@aspiers
Copy link
Author

aspiers commented Jun 18, 2014

This was fixed by 9366bfb from #38.

@aspiers aspiers closed this as completed Jun 18, 2014
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

No branches or pull requests

2 participants