Skip to content

Commit

Permalink
#2321 fix exceptionhandler to include HttpMessageNotWritableException
Browse files Browse the repository at this point in the history
  • Loading branch information
minhyun2 authored and alchan-lee committed Jul 5, 2019
1 parent eafc04b commit 9aada32
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -35,6 +35,7 @@
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.http.converter.HttpMessageNotReadableException;
import org.springframework.http.converter.HttpMessageNotWritableException;
import org.springframework.web.HttpRequestMethodNotSupportedException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseStatus;
Expand Down Expand Up @@ -89,7 +90,7 @@ ResponseEntity<ErrorResponse> handleNotReadable(Exception o_O, WebRequest webReq
* @param o_O the exception to handle.
*/
@ExceptionHandler({InvocationTargetException.class, IllegalArgumentException.class, ClassCastException.class,
ConversionFailedException.class, NullPointerException.class})
ConversionFailedException.class, NullPointerException.class, HttpMessageNotWritableException.class})
ResponseEntity<ErrorResponse> handleMiscFailures(Exception o_O, WebRequest webRequest) {

return errorResponse(HttpStatus.INTERNAL_SERVER_ERROR, new HttpHeaders(), new UnknownServerException(o_O), webRequest);
Expand Down

0 comments on commit 9aada32

Please sign in to comment.