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§
- Cant
Pick - Error returned when the player tries to pick up an item marked as cant_pick.
- Empty
Input - Error returned when trying to process an empty input. The front-end should handle this scenario, but this error is provided as a convenience.
- Invalid
Action - Error returned when the action is invalid
- Invalid
Direction - 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.
- Invalid
Event - Examples
- Invalid
Item - 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.
- Invalid
Movement - 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.
- Invalid
Narrative - 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.
- Invalid
Room - 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.
- Invalid
Subject - 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.
- Invalid
Verb - 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.
- Invalid
Verb Item - Error returned when the parser tries to parse an invalid combination of command tokens.
- Invalid
Verb Item Subject - Error returned when the parser tries to parse an invalid combination of command tokens.
- Invalid
Verb Subject - Error returned when the parser tries to parse an invalid combination of command tokens.
- Item
NotFound - 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.
- Parsing
Room Text - Error returned when the parser tries to parse a room text and fails.
- Required
Event NotCompleted - 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.