Skip to content

Commit

Permalink
Provide more information when raising exception
Browse files Browse the repository at this point in the history
  • Loading branch information
kvid committed Jul 5, 2024
1 parent f2a1aa8 commit ee1bd78
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/wireviz/wireviz.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import platform
import sys
from pathlib import Path
from typing import Any, Dict, List, Tuple, Union
Expand Down Expand Up @@ -420,6 +421,9 @@ def _get_yaml_data_and_path(inp: Union[str, Path, Dict]) -> (Dict, Path):
from errno import EINVAL, ENAMETOOLONG

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

0 comments on commit ee1bd78

Please sign in to comment.