Skip to main content

error

Add a message with the ERROR level.

def error(
request: HttpRequest,
message: string,
extra_tags: string,
fail_silently: boolean = False
) - > null

Add a message with the ERROR level.

Parameters

NameTypeDescription
requestHttpRequestThe current HTTP request object used to retrieve the message storage backend.
messagestringThe content of the error message to be displayed to the user.
extra_tagsstringSpace-separated string of custom CSS classes or identifiers to apply to the message.
fail_silentlyboolean = FalseIf True, suppresses MessageFailure errors when the message backend is not configured.

Returns

TypeDescription
nullNothing is returned; the message is added to the request's message storage.