Fil.UnsupportedError exception (Fil v0.1.0)

Copy Markdown View Source

The disk can't do this operation. Attach a plugin or use another disk.

:op is the operation. Fil returns it with reason: :no_callback for a URL on an adapter without that callback (attach Fil.Plugin.URL), and S3 with reason: :missing_credentials for a signed URL on a disk without credentials.

iex> disk = Fil.disk(adapter: Fil.Adapter.Memory)
iex> {:error, error} = Fil.url(disk, "a.txt")
iex> Exception.message(error)
~s|could not build a URL for "a.txt" on #Fil.Disk<memory>: not supported by this disk (:no_callback)|

Summary

Types

t()

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