incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asa...@apache.org
Subject svn commit: r1404111 - /sling/whiteboard/asanso/plugins/eclipse/slingclipse-plugin/src/org/apache/sling/slingclipse/SlingclipseListener.java
Date Wed, 31 Oct 2012 12:27:23 GMT
Author: asanso
Date: Wed Oct 31 12:27:22 2012
New Revision: 1404111

URL: http://svn.apache.org/viewvc?rev=1404111&view=rev
Log:
SLING-2635 - [Tooling] Logging framework for Slingclipse. Applying patch from Robert Munteanu.

Modified:
    sling/whiteboard/asanso/plugins/eclipse/slingclipse-plugin/src/org/apache/sling/slingclipse/SlingclipseListener.java

Modified: sling/whiteboard/asanso/plugins/eclipse/slingclipse-plugin/src/org/apache/sling/slingclipse/SlingclipseListener.java
URL: http://svn.apache.org/viewvc/sling/whiteboard/asanso/plugins/eclipse/slingclipse-plugin/src/org/apache/sling/slingclipse/SlingclipseListener.java?rev=1404111&r1=1404110&r2=1404111&view=diff
==============================================================================
--- sling/whiteboard/asanso/plugins/eclipse/slingclipse-plugin/src/org/apache/sling/slingclipse/SlingclipseListener.java
(original)
+++ sling/whiteboard/asanso/plugins/eclipse/slingclipse-plugin/src/org/apache/sling/slingclipse/SlingclipseListener.java
Wed Oct 31 12:27:22 2012
@@ -27,6 +27,7 @@ import org.eclipse.core.resources.IResou
 import org.eclipse.core.resources.IResourceDelta;
 import org.eclipse.core.resources.IResourceDeltaVisitor;
 import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Status;
 import org.eclipse.jface.preference.IPreferenceStore;
 
 /**
@@ -41,8 +42,7 @@ public class SlingclipseListener impleme
 		try {
 			rootDelta.accept(buildVisitor());
 		} catch (CoreException e) {
-			// TODO should we do something here in case this fails ?
-			e.printStackTrace();
+			SlingclipsePlugin.getDefault().getLog().log(e.getStatus());
 		}
 	}
 
@@ -52,6 +52,14 @@ public class SlingclipseListener impleme
 			@Override
 			public boolean visit(IResourceDelta delta) throws CoreException { 
 				
+				try {
+					return visitInternal(delta);
+				} catch ( RuntimeException e) {
+					throw new CoreException(new Status(Status.ERROR, SlingclipsePlugin.PLUGIN_ID, "Failed
visiting resource based on delta " + delta, e));
+				}
+			}
+
+			private boolean visitInternal(IResourceDelta delta) {
 				IPreferenceStore store = SlingclipsePlugin.getDefault().getPreferenceStore();
 				
 				if (!store.getBoolean(PreferencesMessages.REPOSITORY_AUTO_SYNC.getKey())){
@@ -93,7 +101,6 @@ public class SlingclipseListener impleme
 
 				}
  				return true;
- 				 
 			}
 			 
 		};



Mime
View raw message