Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Schaefer2016-05-20 01:09:23 +0000
committerGerrit Code Review @ Eclipse.org2016-05-24 05:00:06 +0000
commitc2316a0b184372b1420aad32a5cc83619ff1d5db (patch)
tree04dd15cbae94d2cde8d9d2d936d036a5e3d39044 /toolchains/arduino/org.eclipse.cdt.arduino.core/src/org/eclipse/cdt/arduino/core/internal/Activator.java
parent3d94e24317361141fa2b78b2787d3f5524e11024 (diff)
downloadorg.eclipse.cdt-c2316a0b184372b1420aad32a5cc83619ff1d5db.tar.gz
org.eclipse.cdt-c2316a0b184372b1420aad32a5cc83619ff1d5db.tar.xz
org.eclipse.cdt-c2316a0b184372b1420aad32a5cc83619ff1d5db.zip
Arduino Downloads Manager and lots of cleanup around that.
Diffstat (limited to 'toolchains/arduino/org.eclipse.cdt.arduino.core/src/org/eclipse/cdt/arduino/core/internal/Activator.java')
-rw-r--r--toolchains/arduino/org.eclipse.cdt.arduino.core/src/org/eclipse/cdt/arduino/core/internal/Activator.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/toolchains/arduino/org.eclipse.cdt.arduino.core/src/org/eclipse/cdt/arduino/core/internal/Activator.java b/toolchains/arduino/org.eclipse.cdt.arduino.core/src/org/eclipse/cdt/arduino/core/internal/Activator.java
index e34ed5e625d..85aaa0a2f49 100644
--- a/toolchains/arduino/org.eclipse.cdt.arduino.core/src/org/eclipse/cdt/arduino/core/internal/Activator.java
+++ b/toolchains/arduino/org.eclipse.cdt.arduino.core/src/org/eclipse/cdt/arduino/core/internal/Activator.java
@@ -59,4 +59,17 @@ public class Activator extends Plugin {
return ref != null ? context.getService(ref) : null;
}
+ public static CoreException coreException(Throwable e) {
+ if (e instanceof RuntimeException && e.getCause() instanceof CoreException) {
+ return (CoreException) e.getCause();
+ } else if (e instanceof CoreException) {
+ return (CoreException) e;
+ }
+ return new CoreException(new Status(IStatus.ERROR, getId(), e.getLocalizedMessage(), e));
+ }
+
+ public static CoreException coreException(String message, Throwable e) {
+ return new CoreException(new Status(IStatus.ERROR, getId(), message, e));
+ }
+
}

Back to the top