Skip to content

Types

Every enum, exception and interface, and what each one is for.

Enums

Exceptions

  • ArithmeticError: The error a calculation raises when it has no right answer.
  • Core\Cli\NotInteractive: The error a question throws when nobody is there to answer it.
  • Core\Db\DbError: The error a database throws when it does not accept a statement.
  • Core\Db\RolledBack: The error that is thrown when a program gives up on a transaction it started.
  • Core\DeprecatedError: The error a use of deprecated code throws when the setting errors.deprecated is throw. Code is deprecated when it carries the attribute #[Core\Deprecated]. The error is a LogicError, because the program itself still uses old code.
  • Core\Ldap\LdapError: The error a directory operation throws when it fails.
  • Core\Script\Finished: Every script that ends early ends through this class. Core\Script::finish() raises it, and what travels out is an ordinary raised value, so leaving takes the same path a thrown error takes: every finally between the call and the top of the program runs, and what was opened is closed on the way out. Nothing after the call runs.
  • Core\Test\Failure: The error a failed check throws.
  • ExtensionError: The error a call into an extension throws when the extension's code crashes. An extension is code that runs in a sandbox beside your program, such as the built-in Novis\Image and Novis\Intl. When that code stops on a bug of its own, your call throws ExtensionError. It is a RuntimeError, so a catch (RuntimeError $e) catches it too.
  • IOError: The error a program throws when something outside it failed: a file is missing, a disk is full, or a network connection closed too early.
  • LogicError: The error a program raises when the mistake is its own.
  • ParseError: The error a program throws when input does not match the format it should have: text that is not valid JSON, a field with the wrong type, or a document that is nested too deeply.
  • RecursionError: The error for a call that never comes back. A function that calls itself — a walk over a tree, a parser over nested text — is stopped once the calls are stacked deeper than any working program needs, rather than being left to exhaust the machine and take the whole process with it.
  • RevokedObjectError: RevokedObjectError is the error a program gets when it uses a revoked object. An object is revoked when its class implements Revocable and the program called revoke() on it. The error is a LogicError, which is the error class for a mistake in the program itself.
  • RuntimeError: The error a program raises when something outside it said no.
  • Throwable: The root every error in Novis descends from, and the one a program's own errors extend.
  • TimeoutError: The error for something that did not answer in time: a connection that never opened, a query still running when its limit was reached, a cache that went quiet. It sits under RuntimeError, beside the other refusals that come from outside the program.

Interfaces

  • Comparable: Lets a class of your own say how two of its values are ordered, so everything that sorts can sort them.
  • Core\Router\Gate: The interface your class implements to control Core\Router::dispatch. You pass an instance of the class to dispatch, and it calls three methods:
  • Core\Router\Responder: The interface your class implements to write the response from the value that a route method returns.
  • Iterable: What a class implements so a foreach loop can walk it, the way it walks an array.
  • Iterator: A cursor that walks a sequence once, front to back.
  • KeyedIterable: The interface a class implements so that a foreach loop can give a key and a value for each entry.
  • KeyedIterator: The interface for a cursor that moves through entries one at a time, each with a key and a value.
  • LateInit: LateInit is an interface. A class implements it to give a lateinit property its value the first time a program reads it.
  • Parses: The interface for a class that is built from a piece of text and written back as text.
  • PropertyGuard: PropertyGuard is an interface. A class implements it to check every write of its own properties before the value is stored.
  • PropertyObserver: A class that implements PropertyObserver is told about every read and every write of its own properties.
  • Revocable: The interface for an object that can stop being valid, such as a deleted database row.
  • Stringable: What a class adds so that its objects can be written as text.