diff options
author | Doug Schaefer | 2016-05-20 01:09:23 +0000 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org | 2016-05-24 05:00:06 +0000 |
commit | c2316a0b184372b1420aad32a5cc83619ff1d5db (patch) | |
tree | 04dd15cbae94d2cde8d9d2d936d036a5e3d39044 /toolchains/arduino/org.eclipse.cdt.arduino.core/src/org/eclipse/cdt/arduino/core/internal/Activator.java | |
parent | 3d94e24317361141fa2b78b2787d3f5524e11024 (diff) | |
download | org.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.
Change-Id: Ie2e4d987849831006d443bae98349861871a4057
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.java | 13 |
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)); + } + } |