Skip to main content

abort

Raise an :exc:~werkzeug.exceptions.HTTPException for the given status code.

def abort(
code: int | BaseResponse,
args: t.Any,
kwargs: t.Any
) - > t.NoReturn

Raise an :exc:~werkzeug.exceptions.HTTPException for the given status code. If :data:~flask.current_app is available, it will call its :attr:~flask.Flask.aborter object, otherwise it will use :func:werkzeug.exceptions.abort.

Parameters

NameTypeDescription
code`intBaseResponse`
argst.AnyPassed to the exception.
kwargst.AnyPassed to the exception.

Returns

TypeDescription
t.NoReturn