Commit d893e950 authored by Romain Bioteau's avatar Romain Bioteau
Browse files

BS-14851 Display error dialog when excpetion raised at run

parent 7975fd33
......@@ -131,18 +131,21 @@ public class RunProcessCommand extends AbstractHandler implements IHandler {
} catch (final Exception e) {
BonitaStudioLog.error(e);
status = new Status(IStatus.ERROR, EnginePlugin.PLUGIN_ID, e.getMessage(), e);
if (!runSynchronously) {
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
new BonitaErrorDialog(Display.getDefault().getActiveShell(), Messages.deploymentFailedMessage, Messages.deploymentFailedMessage, e)
.open();
}
});
}
}
if (!runSynchronously && !status.isOK()) {
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
new BonitaErrorDialog(Display.getDefault().getActiveShell(), Messages.deploymentFailedMessage, Messages.deploymentFailedMessage, status,
IStatus.ERROR)
.open();
}
});
}
return status;
}
......
......@@ -5,12 +5,10 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2.0 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
......@@ -47,10 +45,8 @@ import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.commands.ICommandService;
/**
* @author Romain Bioteau
*
*/
public class RunProcessOperation implements IRunnableWithProgress, Runnable {
......@@ -69,8 +65,8 @@ public class RunProcessOperation implements IRunnableWithProgress, Runnable {
return new DeployProcessOperation();
}
/* (non-Javadoc)
/*
* (non-Javadoc)
* @see org.eclipse.jface.operation.IRunnableWithProgress#run(org.eclipse.core.runtime.IProgressMonitor)
*/
@Override
......@@ -130,7 +126,6 @@ public class RunProcessOperation implements IRunnableWithProgress, Runnable {
monitor);
final ProcessAPI processApi = BOSEngineManager.getInstance().getProcessAPI(session);
final Long caseId = processApi.startProcess(deployOperation.getProcessDefId(processToRun)).getId();
url = new CaseDetailURLBuilder(processToRun, configurationId, caseId).toURL(monitor);
new OpenBrowserOperation(url).execute();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment