| 1 | package de.uka.ipd.sdq.dsexplore.exception; |
| 2 | |
| 3 | import org.eclipse.core.runtime.CoreException; |
| 4 | import org.eclipse.core.runtime.Status; |
| 5 | |
| 6 | public class ExceptionHelper { |
| 7 | |
| 8 | private static final String PLUGIN_ID = "de.uka.ipd.sdq.dsexplore"; |
| 9 | |
| 10 | public static CoreException createNewCoreException(String message){ |
| 11 | return new CoreException(new Status(Status.ERROR, PLUGIN_ID, message)); |
| 12 | } |
| 13 | |
| 14 | public static CoreException createNewCoreException(String message, Throwable cause){ |
| 15 | return new CoreException(new Status(Status.ERROR, PLUGIN_ID, message, cause)); |
| 16 | } |
| 17 | |
| 18 | /** |
| 19 | * Could add a specific exception type here. |
| 20 | * @param message |
| 21 | * @return |
| 22 | */ |
| 23 | public static CoreException createNewInitialisationException(String message) { |
| 24 | return createNewCoreException(message); |
| 25 | } |
| 26 | |
| 27 | public static CoreException createNewInitialisationException(String message, Throwable cause) { |
| 28 | return createNewCoreException(message, cause); |
| 29 | } |
| 30 | } |