Only print line and key/value when a line number can be found

This commit is contained in:
Josh Hawkins 2025-01-08 10:12:42 -06:00
parent 66220b762a
commit 99c80ff30a

View File

@ -84,9 +84,10 @@ def main() -> None:
except Exception as traverse_error:
print(f"Could not determine exact line number: {traverse_error}")
print(f"Line # : {line_number}")
print(f"Key : {' -> '.join(map(str, error_path))}")
print(f"Value : {error.get('input','-')}")
if current != full_config:
print(f"Line # : {line_number}")
print(f"Key : {' -> '.join(map(str, error_path))}")
print(f"Value : {error.get('input','-')}")
print(f"Message : {error.get('msg', error.get('type', 'Unknown'))}\n")
print("*************************************************************")