 
   Useful for debugging.
   """
-  @spec get_flag(atom) :: FunWithFlags.Flag.t | nil
+  @spec get_flag(atom) :: FunWithFlags.Flag.t | nil | {:error, any}
   def get_flag(name) do
-    {:ok, names} = all_flag_names()
-    if name in names do
-      {:ok, flag} = Config.persistence_adapter().get(name)
-      flag
-    else
-      nil
+    case all_flag_names() do
+      {:ok, names} ->
+        if name in names do
+          case Config.persistence_adapter().get(name) do
+            {:ok, flag} -> flag
+            error -> error
+          end
+        else
+          nil
+        end
+      error -> error
     end
   end
 

  end

  defp _clear_gate(flag_name, gate) do
    {:ok, _flag} = @store.delete(flag_name, gate)
    :ok
  end




  def enable(flag_name, [for_actor: actor]) when is_atom(flag_name) do
    gate = Gate.new(:actor, actor, true)
    case @store.put(flag_name, gate) do
      {:ok, flag} -> verify(flag, for: actor)
      error -> error
    end
  end


