Search in sources :

Example 1 with NodeJsDebuggerTerminatedException

use of org.eclipse.che.plugin.nodejsdbg.server.exception.NodeJsDebuggerTerminatedException in project che by eclipse.

the class NodeJsDebugger method setValue.

@Override
public void setValue(Variable variable) throws DebuggerException {
    try {
        List<String> path = variable.getVariablePath().getPath();
        if (path.isEmpty()) {
            throw new DebuggerException("Variable path is empty");
        }
        library.setVar(path.get(0), variable.getValue());
    } catch (NodeJsDebuggerTerminatedException e) {
        disconnect();
        throw e;
    } catch (NodeJsDebuggerException e) {
        throw new DebuggerException("Can't set value for " + variable.getName() + ". " + e.getMessage(), e);
    }
}
Also used : DebuggerException(org.eclipse.che.api.debugger.server.exceptions.DebuggerException) NodeJsDebuggerException(org.eclipse.che.plugin.nodejsdbg.server.exception.NodeJsDebuggerException) NodeJsDebuggerException(org.eclipse.che.plugin.nodejsdbg.server.exception.NodeJsDebuggerException) NodeJsDebuggerTerminatedException(org.eclipse.che.plugin.nodejsdbg.server.exception.NodeJsDebuggerTerminatedException)

Example 2 with NodeJsDebuggerTerminatedException

use of org.eclipse.che.plugin.nodejsdbg.server.exception.NodeJsDebuggerTerminatedException in project che by eclipse.

the class NodeJsDebugger method addBreakpoint.

@Override
public void addBreakpoint(Breakpoint breakpoint) throws DebuggerException {
    try {
        Location location = breakpoint.getLocation();
        library.setBreakpoint(location.getTarget(), location.getLineNumber());
        debuggerCallback.onEvent(new BreakpointActivatedEventImpl(breakpoint));
    } catch (NodeJsDebuggerTerminatedException e) {
        disconnect();
        throw e;
    } catch (NodeJsDebuggerException e) {
        throw new DebuggerException("Can't add breakpoint: " + breakpoint + ". " + e.getMessage(), e);
    }
}
Also used : NodeJsDebuggerException(org.eclipse.che.plugin.nodejsdbg.server.exception.NodeJsDebuggerException) DebuggerException(org.eclipse.che.api.debugger.server.exceptions.DebuggerException) NodeJsDebuggerException(org.eclipse.che.plugin.nodejsdbg.server.exception.NodeJsDebuggerException) BreakpointActivatedEventImpl(org.eclipse.che.api.debug.shared.model.impl.event.BreakpointActivatedEventImpl) NodeJsDebuggerTerminatedException(org.eclipse.che.plugin.nodejsdbg.server.exception.NodeJsDebuggerTerminatedException) Location(org.eclipse.che.api.debug.shared.model.Location)

Example 3 with NodeJsDebuggerTerminatedException

use of org.eclipse.che.plugin.nodejsdbg.server.exception.NodeJsDebuggerTerminatedException in project che by eclipse.

the class NodeJsDebugProcess method send.

/**
     * Synchronizes sending commands.
     */
public synchronized void send(String command) throws NodeJsDebuggerException {
    LOG.debug("Execute: {}", command);
    if (!process.isAlive()) {
        throw new NodeJsDebuggerTerminatedException("NodeJs process has been terminated.");
    }
    try {
        processWriter.write(command);
        processWriter.newLine();
        processWriter.flush();
    } catch (IOException e) {
        throw new NodeJsDebuggerException(e.getMessage(), e);
    }
}
Also used : NodeJsDebuggerException(org.eclipse.che.plugin.nodejsdbg.server.exception.NodeJsDebuggerException) IOException(java.io.IOException) NodeJsDebuggerTerminatedException(org.eclipse.che.plugin.nodejsdbg.server.exception.NodeJsDebuggerTerminatedException)

Example 4 with NodeJsDebuggerTerminatedException

use of org.eclipse.che.plugin.nodejsdbg.server.exception.NodeJsDebuggerTerminatedException in project che by eclipse.

the class NodeJsDebugger method start.

@Override
public void start(StartAction action) throws DebuggerException {
    try {
        for (Breakpoint breakpoint : action.getBreakpoints()) {
            Location location = breakpoint.getLocation();
            library.setBreakpoint(location.getTarget(), location.getLineNumber());
            debuggerCallback.onEvent(new BreakpointActivatedEventImpl(breakpoint));
        }
        library.backtrace();
    } catch (NodeJsDebuggerTerminatedException e) {
        disconnect();
        throw e;
    } catch (NodeJsDebuggerException e) {
        throw new DebuggerException("Start error. " + e.getMessage(), e);
    }
}
Also used : Breakpoint(org.eclipse.che.api.debug.shared.model.Breakpoint) NodeJsDebuggerException(org.eclipse.che.plugin.nodejsdbg.server.exception.NodeJsDebuggerException) DebuggerException(org.eclipse.che.api.debugger.server.exceptions.DebuggerException) NodeJsDebuggerException(org.eclipse.che.plugin.nodejsdbg.server.exception.NodeJsDebuggerException) BreakpointActivatedEventImpl(org.eclipse.che.api.debug.shared.model.impl.event.BreakpointActivatedEventImpl) NodeJsDebuggerTerminatedException(org.eclipse.che.plugin.nodejsdbg.server.exception.NodeJsDebuggerTerminatedException) Location(org.eclipse.che.api.debug.shared.model.Location)

Aggregations

NodeJsDebuggerException (org.eclipse.che.plugin.nodejsdbg.server.exception.NodeJsDebuggerException)4 NodeJsDebuggerTerminatedException (org.eclipse.che.plugin.nodejsdbg.server.exception.NodeJsDebuggerTerminatedException)4 DebuggerException (org.eclipse.che.api.debugger.server.exceptions.DebuggerException)3 Location (org.eclipse.che.api.debug.shared.model.Location)2 BreakpointActivatedEventImpl (org.eclipse.che.api.debug.shared.model.impl.event.BreakpointActivatedEventImpl)2 IOException (java.io.IOException)1 Breakpoint (org.eclipse.che.api.debug.shared.model.Breakpoint)1