Skip to content

Commit 5d12811

Browse files
committed
rnacentral_pipeline\rnacentral\r2dt\parser.py broad-exception-caught
Catching Exception might hide unexpected exceptions (e.g., due to new code that will be added). The method parse calls R2DTResultInfo.validate (in line 96).Validate is a sequence of assertions, hence the specific AssertionError can be used instead. See https://stackoverflow.com/questions/1569049/making-pythons-assert-throw-an-exception-that-i-choose
1 parent b31a011 commit 5d12811

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rnacentral_pipeline/rnacentral/r2dt/parser.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def parse(
9494

9595
try:
9696
info.validate()
97-
except Exception as e:
97+
except AssertionError as e:
9898
if allow_missing:
9999
LOGGER.warn("Did not find all required files for %s", urs)
100100
LOGGER.exception(e)

0 commit comments

Comments
 (0)