Skip to content

Commit e6dbe2e

Browse files
committed
Don't use FileNotFoundError
1 parent 81ffc65 commit e6dbe2e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bot/utils/archives.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ def _tar_retrieve_file(archive_data: typing.BinaryIO, filename: str) -> bytes:
1515
"Member has the right name but couldn't extract:", el
1616
)
1717
return fo.read()
18-
raise FileNotFoundError("No member with this name was found in archive:", filename)
18+
raise ValueError("No member with this name was found in archive:", filename)
1919

2020

2121
def _zip_retrieve_file(archive_data: typing.BinaryIO, filename: str) -> bytes:
2222
with zipfile.ZipFile(file=archive_data) as arc:
2323
for el in arc.filelist:
2424
if PurePath(el.filename).name == filename:
2525
return arc.read(el)
26-
raise FileNotFoundError("No member with this name was found in archive:", filename)
26+
raise ValueError("No member with this name was found in archive:", filename)
2727

2828

2929
def archive_retrieve_file(

0 commit comments

Comments
 (0)