-
Notifications
You must be signed in to change notification settings - Fork 25
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
Capture exceptions outside of spiders #6
Comments
I toyed some more with this, and managed to get proper tracebacks working, and am capturing the original exception instead of re-raising:
Pretty happy with this now; Sentry shows the expected traceback. |
What about pull request? Maybe more suitable for raven documentation? |
I wanted to let you decide what do to with it, because it more or less replaces the inner workings of this project. Personally I think there's value in having |
https://github.com/llonchj/scrapy-sentry It's available in PYPI I am curious though. Is it possible to do it without Sentry? Without any client. |
Using sentry-python (named I develop a very simple scrapy extension that catches exceptions and errors inside and outside spiders (including downloader middlewares, item middlewares, etc.): https://gist.github.com/Framartin/4e57b57139ed31f36684cfc514037bf6
|
Thanks @Framartin, works really well so far! |
scrapy-sentry
currently does not capture exceptions that happen outside the spider'son_error
signal. This limits the usefulness of the extension. Luckily, It is pretty easy to fix as well. I currently have this in my Scrapysettings.py
instead of configuring the extension:It should be pretty easy to do the same in the extension, and possibly remove the
on_error
handling. @llonchj, if you agree, I'm happy to prepare a PR for that.Above snippet is not my work, it was discovered by @elmkarami in http://stackoverflow.com/questions/25262765/handle-all-exception-in-scrapy-with-sentry and scrapy/scrapy#852.
The text was updated successfully, but these errors were encountered: