Skip to main content

abort

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

def abort(
code: int | BaseResponse,
args: Any,
kwargs: Any
) - > 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`
argsAnyPositional arguments passed to the exception constructor.
kwargsAnyKeyword arguments passed to the exception constructor.

Returns

TypeDescription
NoReturnThis function does not return as it always raises an HTTPException.