       {:error, error} ->
         Logger.error("Error starting trigger: #{inspect error}.", rule: rule.rule)
         {:stop, :cant_start_trigger}
+      other ->
+        Logger.error("Other error #{inspect other}")
+        {:stop, :cant_start_trigger}
     end
   end
   def init(rule) do


    case start_trigger(uuid, rule.rule["when"]) do
      {:ok, trigger} ->
        # Logger.debug("Got trigger #{inspect trigger}")

        {:ok, %{
          trigger: trigger,
          rule: rule,

            plugin_id: plugin_id,
            stop_id: stop_id,
            }}
        {:error, error} ->
          Logger.error("Error starting rule #{inspect uuid}: #{inspect error}", rule_uuid: uuid, error: error)
          {:error, error}
      end
    else
      [] ->
        Logger.error("Error, trigger for rule #{inspect uuid} not found", rule_uuid: uuid)
        {:error, :not_found}
      {:error, :no_trigger} ->
        Logger.info("Starting rule #{inspect uuid}, with external trigger.", rule_uuid: uuid)
          {:ok, %{
