class EmployeeController {

    @PostMapping(value = "/_update")
    @ResponseBody
    public ResponseEntity<?> update(@RequestBody @Valid EmployeeRequest employeeRequest, BindingResult bindingResult) {
        log.debug("employeeRequest::" + employeeRequest);
        employeeService.setServiceHistoryDetails(employeeRequest,true);
        Employee employee = null;
        try {
            ResponseEntity<?> errorResponseEntity = validateEmployeeRequest(employeeRequest, bindingResult, true);
            if (errorResponseEntity != null)
                return errorResponseEntity;

            employee = employeeService.updateAsync(employeeRequest);
        } catch (UserException ue) {
            log.error("Error while processing request ", ue);
            return errorHandler.getResponseEntityForUserErrors(ue);
        } catch (Exception exception) {
            log.error("Error while processing request ", exception);
            return errorHandler.getResponseEntityForUnexpectedErrors(employeeRequest.getRequestInfo());
        }
        return getSuccessResponseForUpdate(employee, employeeRequest.getRequestInfo());
    }

}