|
Porytiles
|
Abstract interface for all error types used in ChainableResult error chains. More...
#include <error.hpp>
Public Member Functions | |
| virtual | ~Error ()=default |
| virtual std::vector< std::string > | details (const TextFormatter &formatter) const =0 |
| Returns a formatted multi-line string representation of the error. | |
| virtual std::string | join (const TextFormatter &formatter, const std::string &delimiter="\n") const |
| virtual std::unique_ptr< Error > | clone () const =0 |
Abstract interface for all error types used in ChainableResult error chains.
All concrete error types used with ChainableResult must derive from this interface. Implementations should be immutable value types that capture all relevant context about a failure. The clone pattern enables proper copying of errors when building error chains.
|
virtualdefault |
|
pure virtual |
Implemented in porytiles::ImageLoadError, and porytiles::FormattableError.
|
pure virtual |
Returns a formatted multi-line string representation of the error.
Each element in the returned vector represents one line of the error message. The TextFormatter controls whether ANSI styling codes are included based on TTY status.
| formatter | The TextFormatter to use for conditional formatting based on TTY status |
Implemented in porytiles::ImageLoadError, and porytiles::FormattableError.
|
inlinevirtual |