Skip to main content

Errorf

Creates a new error using an error code and a message.

def Errorf(
errorCode: ErrorCode,
msgFmt: string,
args: interface{}
) - > error

Creates a new error using an error code and a message.

Parameters

NameTypeDescription
errorCodeErrorCodeThe specific error code to associate with the new error.
msgFmtstringThe format string for the error message, similar to fmt.Sprintf.
argsinterface{}Arguments to be formatted into the msgFmt string.

Returns

TypeDescription
errorA new error object containing the specified error code and formatted message.