Skip to content

Add fast getting of mapped value #23

@Alex009

Description

@Alex009
inline fun <reified E : Throwable, reified T : Any> E.mapThrowable(): T {
    return ExceptionMappersStorage.throwableMapper<E, T>(T::class)(this)
}

usage:

val myException = IllegalArgumentException("fail!")
val message: StringDesc = myException.mapThrowable()

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions