class FunctionService {

        public Pagination<Function> search(FunctionSearch functionSearch, BindingResult errors) {
            
            try {
                
                List<Function> functions = new ArrayList<>();
                functions.add(functionSearch);
                validate(functions, Constants.ACTION_SEARCH, errors);
    
                if (errors.hasErrors()) {
                    throw new CustomBindException(errors);
                }
            
            } catch (CustomBindException e) {
    
                throw new CustomBindException(errors);
            }
    
            return functionRepository.search(functionSearch);
        }

}