ValidationException

class ValidationException(val errorCode: ErrorCode = ErrorCode.INVALID_PARAMETER, message: String? = null, val field: String? = null, cause: Throwable? = null, val metadata: Map<String, Any> = emptyMap()) : UfcException(source)

Exception for validation failures.

Constructors

Link copied to clipboard
constructor(message: String, field: String? = null, cause: Throwable? = null)
constructor(errorCode: ErrorCode = ErrorCode.INVALID_PARAMETER, message: String? = null, field: String? = null, cause: Throwable? = null, metadata: Map<String, Any> = emptyMap())

Properties

Link copied to clipboard
open val cause: Throwable?
Link copied to clipboard

The error code

Link copied to clipboard
val field: String? = null

The field name that failed validation

Link copied to clipboard
open val message: String?
Link copied to clipboard

Additional metadata (key-value pairs)

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
inline fun <T> getMeta(key: String): T?

Retrieves a value from metadata for a specific key.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun withMeta(newMetadata: Map<String, Any>): UfcException

Creates a new UfcException with multiple additional metadata entries.

fun withMeta(key: String, value: Any): UfcException

Creates a new UfcException with an additional metadata entry.