api_error
#
API Error functionality.
Module Contents#
Functions#
|
Set_user_sentry_context. |
|
Handles unexpected exceptions. |
Attributes#
- api_error.api_error_blueprint#
- exception api_error.ApiError#
Bases:
Exception
ApiError Class to help handle exceptions.
- error_code :str#
- message :str#
- error_line :str =#
- error_type :str =#
- file_name :str =#
- line_number :int = 0#
- offset :int = 0#
- sentry_link :str | None#
- status_code :int = 400#
- tag :str =#
- task_data :dict | str | None#
- task_id :str =#
- task_name :str =#
- task_trace :dict | None#
- __str__() str #
Instructions to print instance as a string.
- classmethod from_task(error_code: str, message: str, task: SpiffWorkflow.task.Task, status_code: int = 400, line_number: int = 0, offset: int = 0, error_type: str = '', error_line: str = '', task_trace: dict | None = None) ApiError #
Constructs an API Error with details pulled from the current task.
- static remove_unserializeable_from_dict(my_dict: dict) dict #
Removes unserializeable from dict.
- static is_jsonable(x: Any) bool #
Attempts a json.dump on given input and returns false if it cannot.
- api_error.set_user_sentry_context() None #
Set_user_sentry_context.
- api_error.handle_exception(exception: Exception) flask.wrappers.Response #
Handles unexpected exceptions.