GeoGenius.ArtifactError exception (geo_genius v0.2.0)

Copy Markdown View Source

Raised when a release's artifacts cannot be listed, or one of them cannot be resolved to a file on this machine.

Carries :reason -- :no_published_release, :unknown_release, :foreign_release, :unknown_artifact, :invalid_cache_key, or :not_cached -- so a caller can tell an artifact nobody has placed in the cache yet, which an operator fixes by placing it, from a logical name this release never composed, which is a caller's own mistake. :not_cached carries the :cache_key the artifact resolves under and the :path it was expected at, because those two values are the whole remedy: a File.Error from inside a stream names neither.

:unknown_release and :foreign_release are separate reasons because they are separate host defects. The first is an id that has gone stale; the second is an id that was never this collection's, which reads another collection's artifacts under this one's name if nothing refuses it.

Summary

Types

reason()

@type reason() ::
  :no_published_release
  | :unknown_release
  | :foreign_release
  | :unknown_artifact
  | :invalid_cache_key
  | :not_cached

t()

@type t() :: %GeoGenius.ArtifactError{
  __exception__: true,
  cache_key: String.t() | nil,
  collection_key: String.t() | nil,
  detail: String.t() | nil,
  logical_name: String.t() | nil,
  message: String.t(),
  path: Path.t() | nil,
  reason: reason(),
  release_id: String.t() | nil
}