Project

General

Profile

Revision 54b2bd04

ID54b2bd0414ba2103f950f7fe982218ffe55243dc
Parent 8d807eba
Child 4f18c04e

Added by Katja Luther almost 3 years ago

ref #7993: missed to commit some changes to catch 403 Exceptiojn

View differences:

eu.etaxonomy.taxeditor.bulkeditor/plugin.xml
137 137
            name="%page.name">
138 138
      </page>
139 139
      <page
140
            category="eu.etaxonomy.taxeditor.preferences.general"
140
            category="eu.etaxonomy.taxeditor.preference.UIPreferences"
141 141
            class="eu.etaxonomy.taxeditor.bulkeditor.preference.BulkEditorGeneralPreferencePage"
142 142
            id="eu.etaxonomy.taxeditor.preferences.bulkeditor.general"
143 143
            name="%page.name.0">
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/l10n/messages_de.properties
60 60
DynamicNewObjectMenuE4_NEW=Neu
61 61
OccurrenceEditorInput_EDITOR_NAME=Specimen-Editor (Liste)
62 62

  
63
BulkEditorGeneralPreferencePage=Zeige Field Units in Listeneditor an
63
BulkEditorGeneralPreferencePage=Field Units in Specimen-Listeneditor anzeigen
eu.etaxonomy.taxeditor.cdmlib/src/main/java/eu/etaxonomy/taxeditor/service/CdmServiceRequestExecutor.java
5 5
import java.util.HashSet;
6 6
import java.util.Set;
7 7

  
8
import org.apache.http.NoHttpResponseException;
8 9
import org.apache.log4j.Logger;
9 10
import org.springframework.remoting.httpinvoker.HttpInvokerClientConfiguration;
10 11
import org.springframework.remoting.support.RemoteInvocation;
......
50 51
	protected RemoteInvocationResult doExecuteRequest(HttpInvokerClientConfiguration config,
51 52
			java.io.ByteArrayOutputStream baos)
52 53
					throws java.io.IOException,
53
					java.lang.ClassNotFoundException {
54
					java.lang.ClassNotFoundException, NoHttpResponseException {
54 55
		RemoteInvocationResult rir = fromCache(currentRemoteInvocation);
55 56

  
56 57
		if(rir == null) {
......
58 59
		    if (!(currentRemoteInvocation.getMethodName() == null) && !(config.getServiceUrl() == null)){
59 60
		       // logger.info("Remote invoking : " + currentRemoteInvocation.getMethodName() + "@" + config.getServiceUrl());
60 61
		    }
61
		    rir = super.doExecuteRequest(config, baos);
62
		    try{
63
		        rir = super.doExecuteRequest(config, baos);
64
		    }catch(Exception e){
65
		        if (e instanceof NoHttpResponseException){
66
		           throw e;
67
		        }
68
		    }
62 69
			if(rir.getValue() != null && !rir.hasException()) {
63 70
			    if (currentRemoteInvocation == null){
64 71
			        logger.debug("return RemoteInvocationResult without caching" );
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/ContextManager.java
24 24
import org.eclipse.ui.PlatformUI;
25 25
import org.eclipse.ui.XMLMemento;
26 26
import org.eclipse.ui.internal.Workbench;
27
import org.springframework.remoting.RemoteAccessException;
27 28

  
28 29
import eu.etaxonomy.taxeditor.model.IContextListener;
29 30
import eu.etaxonomy.taxeditor.model.MementoHelper;
......
81 82
    }
82 83
    /**
83 84
     * <p>notifyContextStart</p>
85
     * @throws Throwable
84 86
     */
85
    public void notifyContextStart() {
87
    public void notifyContextStart() throws RemoteAccessException {
86 88
        MessagingUtils.info("Notifying context listeners, that the context has started.");
87 89
        ProgressMonitorDialog dialog = new ProgressMonitorDialog(StoreUtil.getShell());
88 90

  
......
107 109
                }
108 110
            });
109 111
        } catch (InvocationTargetException e) {
110
            MessagingUtils.error(getClass(), e);
112
            if (e.getTargetException().getClass().equals(RemoteAccessException.class)){
113
                if (e.getTargetException().getMessage().contains("403")){
114
                   // new CdmAuthenticationException("Access Denied", e.getTargetException());
115
                    throw new CdmAuthenticationException("You are logged in now but you are not permitted to use the TaxEditor with the selected data source", e.getTargetException());
116
                }else{
117
                    MessagingUtils.error(getClass(), e.getTargetException());
118
                }
119
            }else{
120
                MessagingUtils.error(getClass(), e);
121
            }
111 122
        } catch (InterruptedException e) {
112 123
            MessagingUtils.error(getClass(), e);
113 124
        }
......
139 150
                }
140 151
            });
141 152
        } catch (InvocationTargetException e) {
142
            MessagingUtils.error(getClass(), e);
153
            if (e.getTargetException().getClass().equals(RemoteAccessException.class)){
154
                if (e.getTargetException().getMessage().contains("403")){
155
                    MessagingUtils.confirmDialog("Access denied", "Access denied");
156
                }else{
157
                    MessagingUtils.error(getClass(), e.getTargetException());
158
                }
159
            }else{
160
                MessagingUtils.error(getClass(), e);
161
            }
143 162
        } catch (InterruptedException e) {
144 163
            MessagingUtils.error(getClass(), e);
145 164
        }

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)