Permalink
Browse files

Catch IOError and turn it into a vidscraper error.

  • Loading branch information...
1 parent c4ced58 commit 9ca2aff404ef38291c0224122f1d63d900edd739 @paulproteus paulproteus committed Jun 8, 2011
Showing with 6 additions and 1 deletion.
  1. +6 −1 vidscraper/__init__.py
View
@@ -99,7 +99,12 @@ def auto_scrape(url, fields=None):
"""
for suite in AUTOSCRAPE_SUITES:
if suite['regex'].match(url):
- return scrape_suite(url, suite, fields)
+ try:
+ return scrape_suite(url, suite, fields)
+ except IOError:
+ raise errors.ParsingError(
+ "We failed to parse the page and got an IOError. " +
+ "Likely this is because the video was deleted, honestly.")
# If we get here that means that none of the regexes matched, so
# throw an error

0 comments on commit 9ca2aff

Please sign in to comment.