Skip to content

Commit

Permalink
Add more verbose logging for JSON decode errors
Browse files Browse the repository at this point in the history
  • Loading branch information
1951FDG committed Mar 19, 2021
1 parent 8185c3d commit fed6151
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion openpyn/firewall.py
Expand Up @@ -299,7 +299,11 @@ def load_allowed_ports(path_to_allowed_ports: str) -> bool:
try:
allowed_ports_config = json.load(file_handle)
except json.JSONDecodeError as json_decode_error:
logger.error("Failed to decode allowed ports JSON")
logger.error(
"Failed to decode allowed ports JSON Error at line {line}:{col} {msg} ".format(
line=json_decode_error.lineno, col=json_decode_error.colno, msg=json_decode_error.msg
)
)
return False

except EnvironmentError as file_read_error:
Expand Down

0 comments on commit fed6151

Please sign in to comment.