Documentation Index
Fetch the complete documentation index at: https://mintlify.com/dev2forge/BasicReturns/llms.txt
Use this file to discover all available pages before exploring further.
BasicReturn is the base return model in BasicReturns. It is a Pydantic BaseModel subclass with two fields — ok and error — that signal whether an operation succeeded and, if not, what went wrong.
Class Signature
Fields
True when the operation completed successfully. Set this to False on failure to signal that something went wrong.The exception or error object captured when
ok is False. Defaults to None on a successful return.Methods
to_dict()
Returns a dictionary representation of the instance.
Whether the operation succeeded.
The error if
ok is False, otherwise None.__str__()
Returns a human-readable string representation of the instance, formatted as:
Usage Example
to_dict() Examples
Success state
BasicReturn is intentionally minimal — it only carries a success flag and an optional error. Use DataAndMsgReturn when you need to return a result payload or a human-readable message alongside the success state.