MappingException

Base of all runtime mapping errors.

Every subtype except UnsupportedConversion carries a path — the field path from the mapping root (e.g. "customer.address.zipCode", "items[3].price"). Seams extend the path via withPathPrefix as the error climbs toward the root: the exception keeps its concrete TYPE and payload, only the path grows (this is NOT wrapping).

R8/proguard note: all names in messages come from caller-provided string literals; nothing is derived via reflection.

Inheritors

Types

Link copied to clipboard
class EmptyCollection(val path: String, val detail: String) : MappingException
Link copied to clipboard
Link copied to clipboard
class TypeConversionFailed(val path: String, val from: String, val to: String, val cause: Throwable) : MappingException
Link copied to clipboard
class UnknownEnumValue(val path: String, val enum: String, val value: Any) : MappingException
Link copied to clipboard

Intentionally-unsupported conversion direction. Path-less by design: the failure is about a TYPE PAIR, not a field, so withPathPrefix is a no-op returning the same instance.

Link copied to clipboard
class ValidationFailed(val path: String, val reason: String) : MappingException

Properties

Link copied to clipboard
expect open val cause: Throwable?
Link copied to clipboard
expect open val message: String?
Link copied to clipboard
abstract val path: String

Field path from the mapping root, e.g. "customer.address.zipCode" or "items3.price".

Functions

Link copied to clipboard
abstract fun withPathPrefix(prefix: String): MappingException

Same exception type with prefix prepended to the path. Used by seams — NOT wrapping. Reconstructing means the rethrown exception's stack trace starts at the prefixing seam; the path string is the locator, by design.