Fil.AlreadyExistsError exception (Fil v0.1.0)

Copy Markdown View Source

A write with if_exists: :error found a file already there. Read that file and decide again.

iex> disk = Fil.disk(adapter: Fil.Adapter.Memory)
iex> Fil.write!(disk, "once.txt", "first")
iex> {:error, %Fil.AlreadyExistsError{}} = Fil.write(disk, "once.txt", "second", if_exists: :error)

Summary

Types

t()

@type t() :: %Fil.AlreadyExistsError{
  __exception__: term(),
  disk: Fil.Disk.t() | nil,
  op: Fil.Op.name() | nil,
  path: String.t() | nil,
  reason: term()
}