AuroraMeter.Config.PrefixError exception (Aurora Meter v1.0.0)

View Source

Raised when a host asks Aurora Meter to live in a Postgres schema other than the repository's default one.

V1 supports the default schema and nothing else. That is not a preference: every query this package issues omits the prefix, so a prefix that reached the migrations and not the queries would put the tables in one schema and read from another, and the first symptom would be an empty ledger rather than an error.

There are three ways a host can ask for it and all three raise this, so the refusal happens before any table is created rather than after the first query comes back empty:

A fourth, AuroraMeter.Migration.up(prefix: ...), raises ArgumentError, because an unknown option is an unknown option whatever it is called.

:source says which of the three it was, so a host rescuing this needs one clause and can still tell the cases apart.

Summary

Types

source()

@type source() ::
  {:repo_config, module(), atom(), term()}
  | {:default_options, module(), atom(), term()}
  | {:migration_runner, term()}

t()

@type t() :: %AuroraMeter.Config.PrefixError{
  __exception__: term(),
  message: String.t(),
  source: source()
}