Skip to content

Commit 11a7b7f

Browse files
committed
fix: Correct spelling of 'graphviz' in error message and enhance error handling in json_formatter
1 parent 64630b7 commit 11a7b7f

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

scripts/diagrams.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ cd "${_PROJECT_DIR}" || exit 2
1313

1414

1515
if ! command -v dot >/dev/null 2>&1; then
16-
echo "[ERROR]: Not found 'dot' command, please install 'graphiz' first!" >&2
16+
echo "[ERROR]: Not found 'dot' command, please install 'graphviz' first!" >&2
1717
exit 1
1818
fi
1919

src/beans_logging/formats.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,16 @@ def json_formatter(record: "Record") -> str:
2020
if record["exception"]:
2121
_error = {}
2222
_error_type, _error_value, _error_traceback = record["exception"]
23-
_error["type"] = str(_error_type)
23+
if _error_type:
24+
_error["type"] = _error_type.__name__
25+
else:
26+
_error["type"] = "None"
27+
2428
_error["value"] = str(_error_value)
2529
_error["traceback"] = "".join(traceback.format_tb(_error_traceback))
2630

2731
_extra = None
28-
if ("extra" in record) and record["extra"] and (0 < len(record["extra"])):
32+
if record["extra"] and (0 < len(record["extra"])):
2933
_extra = record["extra"]
3034

3135
if _extra and ("serialized" in _extra):

0 commit comments

Comments
 (0)