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

[fix] Handle exception when api_bluray fails to get content #2468

Merged
merged 3 commits into from May 3, 2021

Conversation

BrutuZ
Copy link
Contributor

@BrutuZ BrutuZ commented Oct 24, 2019

Motivation for changes:

Flexget would crash if connection to blu-ray.com failed when trying to update movie data such as release date.

Detailed changes:

  • Enclosed the request line in a try:
+            try:
-            movie_info_response = requests.get(self.url).content
+                movie_info_response = requests.get(self.url).content
+            except (requests.RequestException, ConnectionError) as e:
+                raise LookupError('Couldn\'t connect to blu-ray.com. %s' % self.url)
+                break

Addressed issues:

To Do:

  • Review by staff
  • Merge

@BrutuZ BrutuZ changed the title [fix] Handle exception when fails to get content [fix] Handle exception when api_bluray fails to get content Oct 24, 2019
flexget/plugins/internal/api_bluray.py Outdated Show resolved Hide resolved
flexget/plugins/internal/api_bluray.py Outdated Show resolved Hide resolved
try:
movie_info_response = requests.get(self.url).content
except (requests.RequestException, ConnectionError) as e:
raise PluginError("Couldn't connect to blu-ray.com. %s" % self.url)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, now i'm thinking maybe PluginWarning would be better here so we won't abort the task. @gazpachoking @cvium WDYT?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a LookupError?

@gazpachoking gazpachoking merged commit dab230b into Flexget:develop May 3, 2021
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.

Unhandled error with Blu-Ray.com
3 participants