Gilad Chaplik has posted comments on this change.

Change subject: engine: Propagate error message when quering for LDAP 
users/groups
......................................................................


Patch Set 2: (6 inline comments)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/adbroker/LdapBrokerCommandBase.java
Line 67:             LdapCredentials ldapCredentials = new 
LdapCredentials(loginNameForKerberos, getPassword());
Line 68:             DirectorySearcher directorySearcher = new 
DirectorySearcher(ldapCredentials);
Line 69:             executeQuery(directorySearcher);
Line 70:         } catch (RuntimeException e) {
Line 71:             String msg = String.format("Failed to run command %s. 
Domain is %s. User is %s.",
you can use Frontend.getAppErrorsTranslator()
                            
.TranslateErrorTextSingle(returnValue.getExceptionString())
and set a message within the popup.
Line 72:                     getClass().getSimpleName(), getDomain(), 
getLoginName());
Line 73:             log.errorFormat(msg);
Line 74:             _ldapReturnValue.setExceptionString(msg);
Line 75:         }


Line 69:             executeQuery(directorySearcher);
Line 70:         } catch (RuntimeException e) {
Line 71:             String msg = String.format("Failed to run command %s. 
Domain is %s. User is %s.",
Line 72:                     getClass().getSimpleName(), getDomain(), 
getLoginName());
Line 73:             log.errorFormat(msg);
use log.error(str)
Line 74:             _ldapReturnValue.setExceptionString(msg);
Line 75:         }
Line 76:         return _ldapReturnValue;
Line 77:     }


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/SearchQuery.java
Line 198:         ldapQueryData.setFilterParameters(new Object[] { 
data.getQueryForAdBroker() });
Line 199: 
Line 200:         LdapReturnValueBase returnValue =
Line 201:                 
getLdapFactory(data.getDomain()).RunAdAction(adActionType,
Line 202:                         new 
LdapSearchByQueryParameters(data.getDomain(), ldapQueryData));
ok.
Line 203:         
getQueryReturnValue().setSucceeded(returnValue.getSucceeded());
Line 204:         
getQueryReturnValue().setExceptionString(returnValue.getExceptionString());
Line 205:         @SuppressWarnings("unchecked")
Line 206:         List<T> result = (List<T>) returnValue.getReturnValue();


Line 200:         LdapReturnValueBase returnValue =
Line 201:                 
getLdapFactory(data.getDomain()).RunAdAction(adActionType,
Line 202:                         new 
LdapSearchByQueryParameters(data.getDomain(), ldapQueryData));
Line 203:         
getQueryReturnValue().setSucceeded(returnValue.getSucceeded());
Line 204:         
getQueryReturnValue().setExceptionString(returnValue.getExceptionString());
I've got confused because of the runAdActionCommand....
Line 205:         @SuppressWarnings("unchecked")
Line 206:         List<T> result = (List<T>) returnValue.getReturnValue();
Line 207: 
Line 208:         return (result != null) ? result : new ArrayList<T>();


....................................................
File 
frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/Frontend.java
Line 235:                                 + "]"); //$NON-NLS-1$
Line 236:                         if (getEventsHandler() != null) {
Line 237:                             ArrayList<VdcQueryReturnValue> 
failedResult = new ArrayList<VdcQueryReturnValue>();
Line 238:                             failedResult.add(result);
Line 239:                             
getEventsHandler().runQueryFailed(failedResult);
please avoid intoducing this change, look at my previous comment
Line 240:                             String errorMessage = 
result.getExceptionString();
Line 241:                             handleNotLoggedInEvent(errorMessage);
Line 242:                         }
Line 243:                         if (callback.isHandleFailure()) {


....................................................
File 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/users/AdElementListModel.java
Line 244:         _asyncQuery.setHandleFailure(true);
Line 245:         _asyncQuery.asyncCallback = new INewAsyncCallback() {
Line 246:             @Override
Line 247:             public void OnSuccess(Object model, Object ReturnValue)
Line 248:             {
but you don't handle the failure here...
Line 249:                 AdElementListModel adElementListModel = 
(AdElementListModel) model;
Line 250:                 HashSet<Guid> excludeUsers = new HashSet<Guid>();
Line 251:                 if (getExcludeItems() != null)
Line 252:                 {


--
To view, visit http://gerrit.ovirt.org/11893
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I50da72d12c6d60642ad5e65b9376efc49e4ef699
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Asaf Shakarchi <[email protected]>
Gerrit-Reviewer: Alona Kaplan <[email protected]>
Gerrit-Reviewer: Asaf Shakarchi <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Gilad Chaplik <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to