Module errors

Module errors 

Source
Expand description

All possible errors that can occur when parsing the input. These errors should be returned to a front-end for handling display to the user.

All errors have Display implemented for them, so they can be easily serialized to a string.

Structs§

CantPick
Error returned when the player tries to pick up an item marked as cant_pick.
EmptyInput
Error returned when trying to process an empty input. The front-end should handle this scenario, but this error is provided as a convenience.
InvalidAction
Error returned when the action is invalid
InvalidDirection
Error returned when the parser tries to access an invalid direction. This will likely be an issue in the configuration passed to nightrunner_lib when initializing the parser.
InvalidEvent
Examples
InvalidItem
Error returned when the parser tries to access an invalid item. This will likely be an issue in the configuration passed to nightrunner_lib when initializing the parser.
InvalidMovement
Error returned when the parser tries to access an invalid movement. This will likely be an issue in the configuration passed to nightrunner_lib when initializing the parser.
InvalidNarrative
Error returned when the parser tries to access an invalid narrative. This will likely be an issue in the configuration passed to nightrunner_lib when initializing the parser.
InvalidRoom
Error returned when the parser tries to access an invalid room. This will likely be an issue in the configuration passed to nightrunner_lib when initializing the parser.
InvalidSubject
Error returned when the parser tries to access an invalid subject. This will likely be an issue in the configuration passed to nightrunner_lib when initializing the parser.
InvalidVerb
Error returned when the parser tries to access an invalid verb. This will likely be an issue in the configuration passed to nightrunner_lib when initializing the parser.
InvalidVerbItem
Error returned when the parser tries to parse an invalid combination of command tokens.
InvalidVerbItemSubject
Error returned when the parser tries to parse an invalid combination of command tokens.
InvalidVerbSubject
Error returned when the parser tries to parse an invalid combination of command tokens.
ItemNotFound
Error returned when trying to remove an item from the player that is not in their inventory.
NoItem
Error returned when trying to remove an item from the player that is not in their inventory.
NoRoom
Error returned when no room is found while parsing the action.
ParsingRoomText
Error returned when the parser tries to parse a room text and fails.
RequiredEventNotCompleted
Event exists but required events haven’t been completed yet. The front-end should handle this error state since this isn’t really an error, but rather an indication that the action is valid.