Skip to content

Commit 38ca3e2

Browse files
kvid17o2
authored andcommitted
Provide more information when raising exception
1 parent ff6afac commit 38ca3e2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/wireviz/wireviz.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env python3
22
# -*- coding: utf-8 -*-
33

4+
import platform
45
import sys
56
from errno import EINVAL, ENAMETOOLONG
67
from pathlib import Path
@@ -428,6 +429,9 @@ def _get_yaml_data_and_path(inp: Union[str, Path, Dict]) -> Tuple[Dict, Path]:
428429
# Catch these specific errors, but raise any others.
429430

430431
if type(e) is OSError and e.errno not in (EINVAL, ENAMETOOLONG, None):
432+
print(
433+
f"OSError(errno={e.errno}) in Python {sys.version} at {platform.platform()}"
434+
)
431435
raise e
432436
# file does not exist; assume inp is a YAML string
433437
yaml_str = inp

0 commit comments

Comments
 (0)