@ExceptionHandler(IllegalArgumentException.class)
    public ResponseEntity<ErrorResponse> handleIllegalArgumentException(IllegalArgumentException ex) {
        ErrorResponse error = new ErrorResponse(
            "Invalid_Input", 
            "Invalid input parameter: " + ex.getMessage(),
            "Please check your input values and try again.");
        
        return new ResponseEntity<>(error, HttpStatus.BAD_REQUEST);
    }
Handle IllegalArgumentException which occurs when invalid input is provided.

@param ex The exception that was thrown
@return A response with error details
03-GettingStarted/01-first-server/solution/java/src/main/java/com/microsoft/mcp/sample/server/exception/GlobalExceptionHandler.java