WayfinderException class

A failure a host can act on: code is a stable kebab-case identifier, and message a sentence that says what happened and names no command (ADR-0018). The command line prints it and adds what to run; a host words its own remedy from the code and, where one is typed, the exception's data.

The project library throws these codes:

  • bundle-name-invalid, bundle-unknown, bundle-ambiguous, bundle-missing, bundle-escapes, bundles-missing and config-invalid while discovering a project's bundles;
  • the DiagnosticCode value a WayfinderProfileResolutionException carries, such as profile-unresolved, or profile-timeout when reading a Profile package ran past the resolver's bound; its remedy says when selecting new revisions fixes it, and a ProfileSkillDirectoriesException names the skill directories get may not replace;
  • resolution-busy, a ProfileResolutionBusyException, when another get holds the project's lock, or the Profile cache stays locked past its timeout;
  • resolution-stale when the configuration, lock or Profile cache changed after a plan;
  • fetch-required, a ProfileFetchRequiredException, when a plan would clone or refresh a Profile source that the request is offline for or its fetch policy refused;
  • lock-change-required, a ProfileLockChangeRequiredException, when a locked-only plan or a relock would change what wayfinder.lock pins;
  • relock-failed, a ProfileRelockFailedException, when a relock cannot read or replace wayfinder.json or wayfinder.lock;
  • from package:wayfinder/adoption.dart: adoption-invalid, adoption-conflict, adoption-stale, adoption-failed and adoption-profile-conflict, an AdoptionProfileConflictException, when the request names another id than its Profile package declares;
  • from a KnowledgeAssessmentInput.assessWithin that authoring.dart and adoption.dart export: assessment-timeout when a Profile assessment runs past its timeout, and assessment-failed when it stops on an error or cannot start;
  • data-directory-unavailable when no data directory can be located;
  • git-timeout when a Git command writes nothing for its timeout, and git-output-too-large when it writes more stdout than its limit;
  • cancelled when a WayfinderCancellation stopped the operation; a host's GitRunner throws WayfinderException.cancelled for it too.

package:wayfinder/authoring.dart adds write-refused, write-stale, write-failed and the codes of its KnowledgeChangeException. Other Wayfinder packages add their own codes.

Implemented types

Constructors

WayfinderException(String code, String message)
const
WayfinderException.cancelled()
The cancelled failure of an operation a WayfinderCancellation stopped.
const

Properties

code → String
final
hashCode → int
The hash code for this object.
no setterinherited
message → String
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