use of com.ericsson.otp.erlang.OtpErlangDecodeException in project intellij-elixir by KronicDeth.
the class BeamFileImpl method buildFileStub.
public static PsiFileStub<?> buildFileStub(byte[] bytes) {
ElixirFileStubImpl stub = new ElixirFileStubImpl();
Beam beam = null;
try {
beam = Beam.from(bytes);
} catch (IOException e) {
LOGGER.error(e);
} catch (OtpErlangDecodeException e) {
LOGGER.error(e);
}
ModuleStub moduleStub = buildModuleStub(stub, beam);
if (moduleStub == null) {
stub = null;
}
return stub;
}
use of com.ericsson.otp.erlang.OtpErlangDecodeException in project erlide_eclipse by erlang.
the class OtpRpc method getRpcResult.
/**
* Retrieve the result of a RPC.
*
* @param mbox
* @param timeout
* @param env
* @return
* @throws RpcException
*/
@Override
public OtpErlangObject getRpcResult(final OtpMbox mbox, final long timeout, final String env) throws RpcException {
assert mbox != null;
OtpErlangObject res = null;
try {
try {
if (timeout == OtpRpc.INFINITY) {
res = mbox.receive();
} else {
res = mbox.receive(timeout);
}
if (OtpRpc.CHECK_RPC) {
ErlLogger.debug("RPC " + mbox.hashCode() + "<= " + res);
}
} finally {
if (res != null) {
mbox.close();
}
}
if (res == null) {
final String msg = env != null ? env : "??";
throw new RpcTimeoutException(msg);
}
if (!(res instanceof OtpErlangTuple)) {
throw new RpcException(res.toString());
}
final OtpErlangTuple t = (OtpErlangTuple) res;
if (t.arity() != 2) {
throw new RpcException(res.toString());
}
res = t.elementAt(1);
} catch (final OtpErlangExit e) {
throw new RpcException(e);
} catch (final OtpErlangDecodeException e) {
throw new RpcException(e);
}
return res;
}
use of com.ericsson.otp.erlang.OtpErlangDecodeException in project erlide_eclipse by erlang.
the class OtpNodeProxy method receiveEventMessage.
private void receiveEventMessage(final OtpMbox eventBox) throws OtpErlangExit {
OtpErlangObject msg = null;
try {
msg = eventBox.receive(OtpNodeProxy.POLL_INTERVAL);
final ErlEvent busEvent = eventHelper.parse(msg, this);
if (busEvent != null) {
if (OtpNodeProxy.DEBUG) {
ErlLogger.debug("MSG: %s", "[" + busEvent.getSender() + "::" + busEvent.getTopic() + ": " + busEvent.getEvent() + "]");
}
eventBus.post(busEvent);
}
} catch (final OtpErlangExit e) {
ErlLogger.error(e);
throw e;
} catch (final OtpErlangDecodeException e) {
ErlLogger.error(e);
}
}
Aggregations