Skip to main content

json_py_err

No overview available.

def json_py_err(
exception: Exception
) - > str

Converts a Python exception into a JSON-formatted error response for API consistency.

Parameters

NameTypeDescription
exceptionExceptionThe Python exception object to be serialized into the error response.

Returns

TypeDescription
strA JSON string containing the error type and the exception message.