File tree Expand file tree Collapse file tree
src/main/java/uk/gov/hmcts/reform/lrdapi/controllers/advice Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88import org .springframework .http .ResponseEntity ;
99import org .springframework .http .converter .HttpMessageNotReadableException ;
1010import org .springframework .security .access .AccessDeniedException ;
11+ import org .springframework .web .bind .MissingServletRequestParameterException ;
1112import org .springframework .web .bind .annotation .ControllerAdvice ;
1213import org .springframework .web .bind .annotation .ExceptionHandler ;
1314import org .springframework .web .bind .annotation .RequestMapping ;
@@ -106,6 +107,11 @@ public ResponseEntity<Object> handleMethodArgumentTypeMismatchException(Exceptio
106107 return errorDetailsResponseEntity (ex , BAD_REQUEST , ex .getMessage ());
107108 }
108109
110+ @ ExceptionHandler (MissingServletRequestParameterException .class )
111+ public ResponseEntity <Object > handleMissingServletRequestParameterException (Exception ex ) {
112+ return errorDetailsResponseEntity (ex , BAD_REQUEST , ex .getMessage ());
113+ }
114+
109115 private String getTimeStamp () {
110116 return new SimpleDateFormat ("dd-MM-yyyy HH:mm:ss.SSS" , Locale .ENGLISH ).format (new Date ());
111117 }
You can’t perform that action at this time.
0 commit comments