Class ExceptionHandlerExtensions
- java.lang.Object
-
- io.github.astrapi69.spring.exceptionhandling.ExceptionHandlerExtensions
-
public final class ExceptionHandlerExtensions extends java.lang.ObjectThe classExceptionHandlerExtensionsholds factory methods for create the view model bean for exception representations
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ExceptionViewModelnewExceptionViewModel(javax.servlet.http.HttpServletRequest request, org.springframework.http.HttpStatus httpStatus, java.lang.String developerMessage, java.lang.String userMessage)Factory method for create a newExceptionViewModelfrom the given argumentsstatic ExceptionViewModelnewExceptionViewModel(org.springframework.web.context.request.ServletWebRequest request, org.springframework.http.HttpStatus status, java.lang.String developerMessage, java.lang.String userMessage)Factory method for create a newExceptionViewModelfrom the given argumentsstatic ExceptionViewModelnewExceptionViewModelWith(org.springframework.web.context.request.WebRequest request, org.springframework.http.HttpStatus status, java.lang.String developerMessage, java.lang.String userMessage)Factory method for create a newExceptionViewModelfrom the given argumentsstatic org.springframework.http.ResponseEntity<java.lang.Object>newResponseEntity(ExceptionViewModel exceptionViewModel)Factory method for create a newResponseEntitywith the givenExceptionViewModelobjectstatic org.springframework.http.ResponseEntity<java.lang.Object>newResponseEntity(org.springframework.validation.BindException exception, org.springframework.http.HttpHeaders headers, org.springframework.http.HttpStatus status, org.springframework.web.context.request.WebRequest request, org.springframework.context.MessageSource messageSource)Factory method for create a newResponseEntityfrom the given arguments
-
-
-
Method Detail
-
newResponseEntity
public static org.springframework.http.ResponseEntity<java.lang.Object> newResponseEntity(ExceptionViewModel exceptionViewModel)
Factory method for create a newResponseEntitywith the givenExceptionViewModelobject- Parameters:
exceptionViewModel- theExceptionViewModelobject- Returns:
- the new
ResponseEntityobject
-
newExceptionViewModelWith
public static ExceptionViewModel newExceptionViewModelWith(org.springframework.web.context.request.WebRequest request, org.springframework.http.HttpStatus status, java.lang.String developerMessage, java.lang.String userMessage)
Factory method for create a newExceptionViewModelfrom the given arguments- Parameters:
request- the requeststatus- the statusdeveloperMessage- the developer messageuserMessage- the user message- Returns:
- the new
ExceptionViewModelobject
-
newExceptionViewModel
public static ExceptionViewModel newExceptionViewModel(org.springframework.web.context.request.ServletWebRequest request, org.springframework.http.HttpStatus status, java.lang.String developerMessage, java.lang.String userMessage)
Factory method for create a newExceptionViewModelfrom the given arguments- Parameters:
request- the requeststatus- the statusdeveloperMessage- the developer messageuserMessage- the user message- Returns:
- the new
ExceptionViewModelobject
-
newExceptionViewModel
public static ExceptionViewModel newExceptionViewModel(javax.servlet.http.HttpServletRequest request, org.springframework.http.HttpStatus httpStatus, java.lang.String developerMessage, java.lang.String userMessage)
Factory method for create a newExceptionViewModelfrom the given arguments- Parameters:
request- the requesthttpStatus- the http statusdeveloperMessage- the developer messageuserMessage- the user message- Returns:
- the new
ExceptionViewModelobject
-
newResponseEntity
public static org.springframework.http.ResponseEntity<java.lang.Object> newResponseEntity(org.springframework.validation.BindException exception, org.springframework.http.HttpHeaders headers, org.springframework.http.HttpStatus status, org.springframework.web.context.request.WebRequest request, org.springframework.context.MessageSource messageSource)Factory method for create a newResponseEntityfrom the given arguments- Parameters:
exception- the exceptionheaders- the headersstatus- the statusrequest- the requestmessageSource- the message source- Returns:
- the new
ResponseEntityobject
-
-