private void doCall(Map<String, Object> input, int serial) { try { Object result = target.onCommand(new Command(input)); sendToRemote("ref", serial, "result", result); } catch (RemoteException e) { sendErrorNoExceptions(serial, e.getRemoteErrorClass(), e.getRemoteErrorText()); } catch (Exception e) { sendErrorNoExceptions(serial, e.getClass().getSimpleName(), e.getMessage()); } }