py_err_json
No overview available.
def py_err_json(
error: Exception
) - > string
Converts a Python exception into a JSON-formatted string containing the error type and message. Use this to standardize error reporting in API responses or logging systems.
Parameters
| Name | Type | Description |
|---|---|---|
| error | Exception | The Python exception object to be serialized into JSON format. |
Returns
| Type | Description |
|---|---|
string | A JSON string with 'error' and 'message' keys representing the exception details. |