Skip to main content

nok

Returns a dictionary containing an error key mapped to the provided value.

def nok(
value: any
) - > dict

Wraps a provided error message or value into a standardized error dictionary.

Parameters

NameTypeDescription
valueanyThe error message, exception details, or status code to be encapsulated.

Returns

TypeDescription
dictA dictionary containing a single 'error' key mapped to the provided value.