Lightweight 0.20261105.1
Loading...
Searching...
No Matches
Lightweight::SqlRequireLoadedError Class Reference

Raised by the relation shortcuts that cannot return a RelationResult - operator->, operator*, begin()/end(), At() and operator[] - when the relation is unavailable. More...

#include <Error.hpp>

Inheritance diagram for Lightweight::SqlRequireLoadedError:

Public Member Functions

 SqlRequireLoadedError (std::string_view columnType, RelationError error=RelationError::NotConfigured)
 
RelationError Error () const noexcept
 

Detailed Description

Raised by the relation shortcuts that cannot return a RelationResult - operator->, operator*, begin()/end(), At() and operator[] - when the relation is unavailable.

Prefer the accessors returning RelationResult (Record(), All(), Count(), ...) to handle the unavailable case without exceptions.

Definition at line 70 of file Error.hpp.

Constructor & Destructor Documentation

◆ SqlRequireLoadedError()

Lightweight::SqlRequireLoadedError::SqlRequireLoadedError ( std::string_view  columnType,
RelationError  error = RelationError::NotConfigured 
)
inlineexplicit

Constructs the error with the name of the column type that failed to load.

Parameters
columnTypeThe relation type, for the message.
errorWhy it failed.

Definition at line 77 of file Error.hpp.

Member Function Documentation

◆ Error()

RelationError Lightweight::SqlRequireLoadedError::Error ( ) const
inlinenoexcept
Returns
Why the relation could not be loaded.

Definition at line 84 of file Error.hpp.


The documentation for this class was generated from the following file: