ErrorConverterRegistrar

Registry for managing error converters by exception type.

This object maintains a mapping of exception classes to their corresponding ErrorConverter implementations. It automatically loads and registers converters from the ServiceLoader during initialization, and provides methods for manual registration and lookup.

The registrar uses a thread-safe ConcurrentHashMap to ensure safe concurrent access.

See also

Functions

Link copied to clipboard
fun get(throwableClass: Class<out Throwable>): ErrorConverter<Throwable>?

Retrieves the error converter for a specific exception type.

Link copied to clipboard

Registers an error converter using a factory.

fun register(throwableClass: Class<out Throwable>, errorConverter: ErrorConverter<Throwable>): ErrorConverter<Throwable>?

Registers an error converter for a specific exception type.

Link copied to clipboard
fun unregister(throwableClass: Class<out Throwable>): ErrorConverter<Throwable>?

Unregisters the error converter for a specific exception type.