DatabaseUnavailable class

What a database function throws when there is no database to reach — no one is signed in, the session is closing, the environment is switching.

It exists for its toString. An error crossing the channel travels as its message and nothing else, and lands verbatim in the cockpit's error pane and in an MCP reply, so StateError puts "Bad state:" in front of a sentence somebody has to read and ArgumentError does worse. This puts nothing in front of it.

The message is for whoever hits it, which is often an agent that cannot see the screen: say what is missing and what would fix it — "No session is open — sign in to reach the database" rather than "no database".

Implemented types

Constructors

DatabaseUnavailable(String reason)

Properties

hashCode → int
The hash code for this object.
no setterinherited
reason → String
A sentence, shown exactly as written.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited