Skip to content

Commit 967846a

Browse files
more granular error messages
Signed-off-by: govinda-kamath <[email protected]>
1 parent 797ea3d commit 967846a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

openslide/lowlevel.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,14 @@ def _load_library() -> CDLL:
7272
pass
7373

7474
def try_load(names: list[str]) -> CDLL:
75+
error_strings = []
7576
for name in names:
7677
try:
7778
return cdll.LoadLibrary(name)
78-
except OSError:
79+
except OSError as err:
80+
error_strings.append(f"{name}: {err}")
7981
if name == names[-1]:
80-
raise
82+
raise OSError("\n".join(error_strings))
8183
else:
8284
raise ValueError('No library names specified')
8385

0 commit comments

Comments
 (0)