aboutsummaryrefslogtreecommitdiffstats
path: root/bsie/reader/chain.py
diff options
context:
space:
mode:
authorMatthias Baumgartner <dev@igsor.net>2023-01-16 20:53:39 +0100
committerMatthias Baumgartner <dev@igsor.net>2023-01-16 20:53:39 +0100
commitafd165000c1661a9cca117a4844ad3f89d926fdb (patch)
tree865a1077c56d2f373af9cdc1b800516fdd0695f0 /bsie/reader/chain.py
parent3f93be488638fdf6668e0e03e2b1634bb969ca80 (diff)
downloadbsie-afd165000c1661a9cca117a4844ad3f89d926fdb.tar.gz
bsie-afd165000c1661a9cca117a4844ad3f89d926fdb.tar.bz2
bsie-afd165000c1661a9cca117a4844ad3f89d926fdb.zip
unsupported file format exception
Diffstat (limited to 'bsie/reader/chain.py')
-rw-r--r--bsie/reader/chain.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/bsie/reader/chain.py b/bsie/reader/chain.py
index 8e900e1..db7c2d5 100644
--- a/bsie/reader/chain.py
+++ b/bsie/reader/chain.py
@@ -73,13 +73,16 @@ class ReaderChain(base.Reader, typing.Generic[T_CONTENT]):
return hash((super().__hash__(), self._children))
def __call__(self, path: str) -> T_CONTENT:
+ raise_error = errors.UnsupportedFileFormatError
for child in self._children:
try:
return child(path)
+ except errors.UnsupportedFileFormatError:
+ pass
except errors.ReaderError:
# child cannot read the file, skip.
- pass
+ raise_error = errors.ReaderError # type: ignore [assignment] # mypy is confused
- raise errors.ReaderError(path)
+ raise raise_error(path)
## EOF ##