|
Porytiles
|
General-purpose error implementation with formatted message support. More...
#include <error.hpp>
Public Member Functions | |
| FormattableError ()=default | |
| FormattableError (std::string text) | |
| FormattableError (std::string text, std::vector< FormatParam > params) | |
| template<typename FirstParam , typename... RestParams> requires ( !std::is_same_v<std::decay_t<FirstParam>, std::vector<FormatParam>> && std::is_same_v<std::decay_t<FirstParam>, FormatParam> && (std::is_same_v<std::decay_t<RestParams>, FormatParam> && ...)) | |
| FormattableError (std::string text, FirstParam &&first, RestParams &&...rest) | |
| FormattableError (std::vector< std::string > lines) | |
| FormattableError (std::vector< std::string > lines, std::vector< std::vector< FormatParam > > params) | |
| std::vector< std::string > | details (const TextFormatter &formatter) const override |
| Returns a formatted multi-line string representation of the error. | |
| bool | has_details () const |
| std::unique_ptr< Error > | clone () const override |
Public Member Functions inherited from porytiles::Error | |
| virtual | ~Error ()=default |
| virtual std::string | join (const TextFormatter &formatter, const std::string &delimiter="\n") const |
General-purpose error implementation with formatted message support.
FormattableError is a concrete Error implementation for common error scenarios where a specialized error type would be unnecessary overhead. It supports plain string messages, format strings with styled FormatParam substitution, and multi-line error messages. TTY-aware styling is handled automatically through TextFormatter.
|
default |
|
inlineexplicit |
|
inlineexplicit |
|
inlineexplicit |
|
inlineexplicit |
|
inlineexplicit |
|
inlineoverridevirtual |
Implements porytiles::Error.
|
inlineoverridevirtual |
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 |
Implements porytiles::Error.
|
inline |