Fil.InvalidRequestError exception (Fil v0.1.0)

Copy Markdown View Source

The path or the content can't be used here. Use another path or smaller content.

Fil returns it with reason: :ebadpath for a path that escapes the disk root, before any adapter or plugin sees it. Adapters return it for a file operation on a directory (:eisdir), a path under a file (:enotdir), a name that's too long, and content over the storage's size limit.

iex> disk = Fil.disk(adapter: Fil.Adapter.Memory)
iex> {:error, %Fil.InvalidRequestError{} = error} = Fil.read(disk, "../escape.txt")
iex> error.reason
:ebadpath

Summary

Types

t()

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