of

fun of(errorCode: String, errorMsg: String? = null, bindingErrors: List<BindingError> = emptyList()): DefaultErrorInfo

Creates a new ErrorInfo instance with the specified parameters.

This factory method provides a convenient way to create error information instances without directly instantiating DefaultErrorInfo. It handles null error messages by converting them to empty strings.

Return

A new DefaultErrorInfo instance with the specified error details

Parameters

errorCode

The error code that identifies the type of error (must not be null)

errorMsg

An optional human-readable error message (defaults to empty string if null)

bindingErrors

A list of field-level binding errors (defaults to empty list)

Samples