Skip to content

Commit

Permalink
style: explicitly re-raise execptions
Browse files Browse the repository at this point in the history
  • Loading branch information
ekkolon committed Nov 29, 2023
1 parent e13fc59 commit 1286176
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions deepface/commons/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ def load_image(img):
img = cv2.imdecode(chunk_arr, cv2.IMREAD_COLOR)
return img

except cv2.error:
raise ValueError(f"Image '{img}' contains invalid data")
except cv2.error as exc:
raise ValueError(f"Image '{img}' contains invalid data") from exc

except Exception as e:
raise e
except Exception as exc:
raise exc

# This causes troubles when reading files with non english names
# return cv2.imread(img)
Expand Down

0 comments on commit 1286176

Please sign in to comment.