DefaultErrorInfo

data class DefaultErrorInfo(val errorCode: String, val errorMsg: String = "", val bindingErrors: List<BindingError> = emptyList()) : ErrorInfo, Materialized

Default implementation of the ErrorInfo interface.

This data class provides a concrete, serializable implementation of error information that can be used directly in API responses, logging, and error handling. It implements Materialized to ensure it can be properly serialized in JSON responses and stored in databases.

See also

for the interface definition

for convenient factory method

Samples

Constructors

Link copied to clipboard
constructor(errorCode: String, errorMsg: String = "", bindingErrors: List<BindingError> = emptyList())

Properties

Link copied to clipboard
open override val bindingErrors: List<BindingError>

A list of field-level validation errors (empty by default)

Link copied to clipboard
open override val errorCode: String

The error code that identifies the type of error

Link copied to clipboard
open override val errorMsg: String

A human-readable message describing the error (empty for success)

Link copied to clipboard
open val succeeded: Boolean

Indicates whether the operation was successful.

Functions

Link copied to clipboard

Converts this ErrorInfo to a materialized instance for serialization.

Link copied to clipboard

Converts this ErrorInfo to a DefaultErrorInfo instance.