Package com.example.blogs.app.exception
Class ExceptionHttpStatusMapper
java.lang.Object
com.example.blogs.app.exception.ExceptionHttpStatusMapper
Maps domain-specific exceptions to appropriate HTTP status codes.
Defaults to 500 INTERNAL_SERVER_ERROR for unmapped exceptions.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionResolves the HTTP status for a given exception.
-
Constructor Details
-
ExceptionHttpStatusMapper
public ExceptionHttpStatusMapper()
-
-
Method Details
-
resolve
Resolves the HTTP status for a given exception.- Parameters:
ex- the exception to resolve- Returns:
- corresponding HTTP status or INTERNAL_SERVER_ERROR if not mapped
-