From 38ca3e2689c0ed5db8512fa464208e7ca861b375 Mon Sep 17 00:00:00 2001 From: KV Date: Thu, 4 Jul 2024 18:41:59 +0200 Subject: [PATCH] Provide more information when raising exception --- src/wireviz/wireviz.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/wireviz/wireviz.py b/src/wireviz/wireviz.py index 92ccbc1..8076f78 100755 --- a/src/wireviz/wireviz.py +++ b/src/wireviz/wireviz.py @@ -1,6 +1,7 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- +import platform import sys from errno import EINVAL, ENAMETOOLONG from pathlib import Path @@ -428,6 +429,9 @@ def _get_yaml_data_and_path(inp: Union[str, Path, Dict]) -> Tuple[Dict, Path]: # Catch these specific errors, but raise any others. 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