Use cases
mongorunway.application.use_cases
¤
ALL: typing.Final[str] = 'all'
module-attribute
¤
ExitCode: typing.TypeAlias = int
module-attribute
¤
FAILURE: typing.Final[ExitCode] = 1
module-attribute
¤
MINUS: typing.Final[str] = '-'
module-attribute
¤
PLUS: typing.Final[str] = '+'
module-attribute
¤
SUCCESS: typing.Final[ExitCode] = 0
module-attribute
¤
UseCaseFailed: typing.TypeAlias = object()
module-attribute
¤
Use case callback sentinel.
Some use cases that are designed to retrieve specific data may, by design, return None. However, since errors at the use case level are not raised but handled and logged to the console, it has been decided to make it a general rule to return the UseCaseFailed sentinel in case of a failed use case.
Notes¤
It is important to differentiate between ExitCode and this sentinel: 'ExitCode' is returned by commands that are meant to perform a specific action without being tied to a particular result. On the other hand, as mentioned earlier, UseCaseFailed is intended for the opposite scenario: for commands that are meant to search and compute data and are expected to return a result.
See Also¤
ExitCode