@Override public void run(Action action) throws ActionFailureException, ActionParameterException { // Look it up. final SshActionDefinition actionDef = actionDefinitions.get(action.getAppliesToActionDefinition()); if (actionDef == null) { throw new ActionFailureException("Action is not provided by the SSH provider. Please open a bug."); } actionDef.run(action); }
@Override public void run(Action action) throws ActionFailureException, ActionParameterException { // Look it up. final AbstractPushMessageActionDefinition actionDef = actionDefinitions.get(action.getAppliesToActionDefinition()); if (actionDef == null) { throw new ActionFailureException("Action is not provided by the PushOver provider. Please open a bug."); } actionDef.run(action); }
@Override public void run(Action action) throws ActionFailureException, ActionParameterException { // Look it up. final WemoActionDefinition actionDef = actionDefinitions.get(action.getAppliesToActionDefinition()); if (actionDef == null) { throw new ActionFailureException("Action is not provided by the " + getName() + " provider. Please open a bug."); } actionDef.run(action); }
session = jsch.getSession(userName, host, port); } catch (JSchException e) { throw new ActionFailureException("Could not configure SSH client.", e); session.connect(); } catch (JSchException e) { throw new ActionFailureException("Could not connect to SSH server:" + e.getMessage(), e); channelExec = (ChannelExec) session.openChannel("exec"); } catch (JSchException e) { throw new ActionFailureException("Could not open a channel with SSH server:" + e.getMessage(), e); channelExec.connect(); } catch (JSchException e) { throw new ActionFailureException("Could not execute command on SSH server:" + e.getMessage(), e); } while (rc == -1); } catch (InterruptedException e) { throw new ActionFailureException("Interrupted before command completed.", e); } finally { channelExec.disconnect(); throw new ActionFailureException("Command completed with return code " + rc);
failNames[i] = device.getFriendlyName() + " (" + device.getUniqueDeviceName() + ")"; throw new ActionFailureException("Could not switch all matching Wemo devices (" + Arrays.toString(failNames) + ')');
@Override public void run(Action action) throws ActionFailureException, ActionParameterException { if (LOG.isTraceEnabled()) { LOG.entry(action); } final UUID actionDefinitionUuid = action.getAppliesToActionDefinition(); final UUID providerUuid = actionDefinitionToProvider.get(actionDefinitionUuid); final Provider provider = providers.get(providerUuid); try { provider.run(action); } catch (ActionFailureException | ActionParameterException e) { LOG.throwing(e); throw e; } catch (Exception e) { // Any unknown or unexpected exceptions are wrapped as a failure and thrown. final ActionFailureException afe = new ActionFailureException(e); LOG.throwing(afe); throw afe; } if (LOG.isTraceEnabled()) { LOG.exit(); } }
throw new ActionParameterException(e.getMessage(), e); } catch (IOException e) { throw new ActionFailureException(e.getMessage(), e);
client.sendMessage(rpcMessage); } catch (JsonProcessingException e) { final ActionFailureException t = new ActionFailureException("Failed to build show notification message.", e); if (logger.isTraceEnabled()) { logger.throwing(t);