Search in sources :

Example 36 with RpcException

use of org.erlide.runtime.rpc.RpcException in project erlide_eclipse by erlang.

the class ErlideDebug method setVariableValue.

@SuppressWarnings("boxing")
public static String setVariableValue(final IOtpRpc backend, final String name, final String value, final int stackFrameNo, final OtpErlangPid meta) {
    try {
        final OtpErlangObject res = backend.call(ErlideDebug.ERLIDE_DEBUG, "set_variable_value", "ssix", name, value, stackFrameNo + 1, meta);
        try {
            final OtpBindings bind = OtpErlang.match("{eval_rsp, {'EXIT', Val}}", res);
            if (bind == null) {
                return null;
            }
            final String err = bind.getAsString("Val");
            return err;
        } catch (final OtpParserException e1) {
        }
        return null;
    } catch (final RpcException e) {
        ErlLogger.warn(e);
    }
    return "error";
}
Also used : OtpParserException(org.erlide.util.erlang.OtpParserException) OtpErlangObject(com.ericsson.otp.erlang.OtpErlangObject) OtpBindings(org.erlide.util.erlang.OtpBindings) RpcException(org.erlide.runtime.rpc.RpcException)

Example 37 with RpcException

use of org.erlide.runtime.rpc.RpcException in project erlide_eclipse by erlang.

the class ErlideReshd method start.

@Override
public OtpErlangPid start(final IOtpNodeProxy runtime) {
    try {
        final OtpErlangObject r = runtime.getOtpRpc().call("erlide_shell", "start", "p", runtime.getEventPid());
        final OtpErlangPid server = (OtpErlangPid) BackendUtils.ok(r);
        return server;
    } catch (final RpcException e) {
        return null;
    }
}
Also used : OtpErlangPid(com.ericsson.otp.erlang.OtpErlangPid) OtpErlangObject(com.ericsson.otp.erlang.OtpErlangObject) RpcException(org.erlide.runtime.rpc.RpcException)

Aggregations

RpcException (org.erlide.runtime.rpc.RpcException)37 OtpErlangObject (com.ericsson.otp.erlang.OtpErlangObject)30 OtpErlangTuple (com.ericsson.otp.erlang.OtpErlangTuple)15 OtpErlangList (com.ericsson.otp.erlang.OtpErlangList)12 OtpErlangAtom (com.ericsson.otp.erlang.OtpErlangAtom)8 OtpErlangString (com.ericsson.otp.erlang.OtpErlangString)7 ArrayList (java.util.ArrayList)7 IOtpRpc (org.erlide.runtime.rpc.IOtpRpc)6 RpcFuture (org.erlide.runtime.rpc.RpcFuture)5 OtpErlangPid (com.ericsson.otp.erlang.OtpErlangPid)4 TimeoutException (java.util.concurrent.TimeoutException)4 CoverException (org.erlide.cover.api.CoverException)4 IErlModule (org.erlide.engine.model.root.IErlModule)4 RpcTimeoutException (org.erlide.runtime.rpc.RpcTimeoutException)4 Test (org.junit.Test)4 OtpErlangLong (com.ericsson.otp.erlang.OtpErlangLong)3 OtpErlangRangeException (com.ericsson.otp.erlang.OtpErlangRangeException)3 IPath (org.eclipse.core.runtime.IPath)3 IStatus (org.eclipse.core.runtime.IStatus)3 Status (org.eclipse.core.runtime.Status)3