diff --git a/README.md b/README.md index 06f2446..5c63f16 100644 --- a/README.md +++ b/README.md @@ -89,11 +89,13 @@ Interceptor для логирования запросов/ответов. ## exception-handler-spring-web -Перехватывает ошибки сервера, определяет код ошибки и возвращает их в правильный `response` +Перехватывает ошибки сервера, определяет код ошибки и возвращает их в правильный `response`. +Подключается с помощью аннотации `@EnableSpringExceptionHandler` ## exception-handler-logger-spring-web -Добавляет логирование в обработку ошибок +Добавляет логирование в обработку ошибок. +Подключается с помощью аннотации `@EnableSpringExceptionHandlerLogger` до подключения основного модуля. ## version-spring-web diff --git a/exception-handler-logger-spring-web/src/main/kotlin/ru/touchin/exception/handler/spring/EnableSpringExceptionHandler.kt b/exception-handler-logger-spring-web/src/main/kotlin/ru/touchin/exception/handler/spring/EnableSpringExceptionHandler.kt new file mode 100644 index 0000000..e93b533 --- /dev/null +++ b/exception-handler-logger-spring-web/src/main/kotlin/ru/touchin/exception/handler/spring/EnableSpringExceptionHandler.kt @@ -0,0 +1,8 @@ +@file:Suppress("unused") +package ru.touchin.exception.handler.spring + +import org.springframework.context.annotation.Import +import ru.touchin.exception.handler.spring.configurations.ExceptionHandlerLoggerConfiguration + +@Import(value = [ExceptionHandlerLoggerConfiguration::class]) +annotation class EnableSpringExceptionHandlerLogger