이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Chapter 24. Exception Handling
24.1. Exception Mappers 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
ExceptionMapper
s are custom, application-provided components that can catch application exceptions and write specific HTTP responses. They are associated with @Provider
, and implement the following interface:
When an application throws an exception, the exception is caught by the JAX-RS runtime. JAX-RS then scans registered
ExceptionMapper
s to locate one which supports marshalling the exception type thrown. An example ExceptionMapper
follows:
ExceptionMapper
s are registered in the same way as MessageBodyReader
s and MessageBodyWriter
s: by scanning through the RESTEasy provider context-param
(if you are deploying in a WAR
file), or programmatically through the ResteasyProviderFactory
class.