Skip to content

//misk/misk.web.exceptions

Package-level declarations

Types

Name Summary
ActionExceptionLogLevelConfig [jvm]
data class ActionExceptionLogLevelConfig@JvmOverloadsconstructor(val client_error_level: Level = Level.WARN, val server_error_level: Level = Level.ERROR) : Config
Configures the log Level for an ActionException.
ExceptionHandlingInterceptor [jvm]
class ExceptionHandlingInterceptor(actionName: String, mapperResolver: ExceptionMapperResolver) : NetworkInterceptor
Converts and logs application and component level dispatch exceptions into the appropriate response format. Allows application and component code to control how exceptions are represented to clients; for example by setting the status code appropriately, or by returning a specialized response format specific to the error. Components can control how exceptions are mapped by installing ExceptionMapper via the ExceptionMapperModule
ExceptionMapper [jvm]
interface ExceptionMapper<in T : Throwable>
Maps an exception to a Response
ExceptionMapperModule [jvm]
class ExceptionMapperModule<M : ExceptionMapper<T>, in T : Throwable>(exceptionClass: KClass<T>, mapperClass: KClass<M>) : KAbstractModule
Binds a Throwable to an ExceptionMapper.
ExceptionMapperResolver [jvm]
@Singleton
class ExceptionMapperResolver
GrpcErrorResponse [jvm]
data class GrpcErrorResponse@JvmOverloadsconstructor(val status: GrpcStatus, val message: String?, val details: List<AnyMessage> = listOf())
RequestBodyExceptionMapper [jvm]
class RequestBodyExceptionMapper : ExceptionMapper<RequestBodyException>

Functions

Name Summary
toGrpcStatus [jvm]
fun toGrpcStatus(statusCode: Int): GrpcStatus
https://grpc.github.io/grpc/core/md_doc_http-grpc-status-mapping.html