DefaultErrorConverter

Default error converter that handles common exception types.

This converter provides standard mappings from common Java exceptions to Wow error codes. It handles ErrorInfoCapable exceptions, direct ErrorInfo instances, and maps standard exceptions like IllegalArgumentException, IllegalStateException, etc. to appropriate error codes.

For exceptions that don't have specific mappings, it defaults to BAD_REQUEST.

Example usage:

val errorInfo = DefaultErrorConverter.convert(IllegalArgumentException("Invalid input"))
// Returns ErrorInfo with code "IllegalArgument"

See also

Functions

Link copied to clipboard
open override fun convert(error: Throwable): ErrorInfo

Converts a Throwable to ErrorInfo using standard mappings.