Companion

object Companion

Companion object for ErrorInfo that provides constants and utility functions to work with ErrorInfo instances.

It includes predefined success status values, a method to materialize an ErrorInfo instance into a Materialized one, and a factory function to create ErrorInfo instances.

Properties

Link copied to clipboard
Link copied to clipboard
const val SUCCEEDED: String

A constant representing a successful operation or status. This value is typically used in the context of error handling and response descriptions to indicate that an operation has been completed successfully.

Link copied to clipboard

Represents the message associated with a successful operation. This constant is used to provide a standard message for operations that complete without errors.

Functions

Link copied to clipboard

Converts the current ErrorInfo instance into a Materialized if it is not already one. If the current instance is of type Materialized, it returns itself. Otherwise, it creates a new DefaultErrorInfo with the current error code, error message, and binding errors.

Link copied to clipboard
fun of(errorCode: String, errorMsg: String? = null, bindingErrors: List<BindingError> = emptyList()): ErrorInfo

Creates an instance of ErrorInfo with the specified error code, optional error message, and a list of binding errors.