Skip to content

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

Merged
gazpachoking merged 3 commits intoFlexget:developfrom
BrutuZ:api_bluray-patch
May 3, 2021
Merged

[fix] Handle exception when api_bluray fails to get content#2468
gazpachoking merged 3 commits intoFlexget:developfrom
BrutuZ:api_bluray-patch

Conversation

@BrutuZ
Copy link
Copy Markdown
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
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
Copy Markdown
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
Copy Markdown
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