Fil.NotFoundError exception (Fil v0.1.0)

Copy Markdown View Source

The file doesn't exist. Treat it as missing.

Adapters return it for a missing file, a missing directory and a path that goes through a file (report.txt/x), which doesn't exist on an object store either.

iex> disk = Fil.disk(adapter: Fil.Adapter.Memory)
iex> {:error, error} = Fil.read(disk, "nope.txt")
iex> {error.op, error.path, error.reason}
{:read, "nope.txt", :enoent}
iex> error.disk == disk
true
iex> Exception.message(error)
~s|could not read "nope.txt" on #Fil.Disk<memory>: no such file (:enoent)|

Summary

Types

t()

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