Skip to content

Commit

Permalink
Merge pull request #13 from inuits/bug/dont-depend-flask
Browse files Browse the repository at this point in the history
refs #123105 Remove try except and catch exception where method is used.
  • Loading branch information
Delsinvg authored Feb 28, 2024
2 parents 0cd37eb + d7fd943 commit 93d5ac1
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/elody/client.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import os
import requests

from flask_restful import abort
from .exceptions import NonUniqueException, NotFoundException


Expand Down Expand Up @@ -114,13 +113,10 @@ def get_all_objects(self, collection):
return self.__handle_response(response, "Failed to get objects")

def get_mediafiles_and_check_existence(self, mediafile_ids):
try:
mediafile_image_data = []
for mediafile_id in mediafile_ids:
response = self.get_object("mediafiles", mediafile_id)
mediafile_image_data.append(response)
except Exception as ex: # it doesn't exist
abort(400, message=str(ex))
mediafile_image_data = []
for mediafile_id in mediafile_ids:
response = self.get_object("mediafiles", mediafile_id)
mediafile_image_data.append(response)
return mediafile_image_data

def get_object(self, collection, identifier):
Expand Down

0 comments on commit 93d5ac1

Please sign in to comment.