Skip to content

ConfigError

#include <mrx/core/config/ConfigSchema.hpp>
class mrx::core::ConfigError

Describes one parser or validation failure produced by ConfigSchema.

Paths use section.property notation. Unknown-property errors may include a nearby declared property name in suggestion(), and toString() renders that suggestion for user-facing output.

ReturnNameDescription
ConfigErrorConstructs an empty parser error.
ConfigErrorConstructs a descriptive validation error.
Codecode constReturns the machine-readable error category.
QStringpath constReturns the dotted section/property path.
QStringmessage constReturns the human-readable failure reason without a suggestion.
QStringsuggestion constReturns the suggested property name, or an empty string if none exists.
QStringtoString constFormats the path, reason, and optional suggestion as one message.

ConfigError()

Constructs an empty parser error.


ConfigError(Code code, const QString& path, const QString& message, const QString& suggestion = QString())

Constructs a descriptive validation error.

NameTypeDescription
codeCodeCategory of validation failure.
pathconst QString&Dotted section/property path associated with the failure.
messageconst QString&Human-readable reason for the failure.
suggestionconst QString&Optional property name suggestion for an unknown property.

const
Code code() const

Returns the machine-readable error category.


const
QString path() const

Returns the dotted section/property path.


const
QString message() const

Returns the human-readable failure reason without a suggestion.


const
QString suggestion() const

Returns the suggested property name, or an empty string if none exists.


const
QString toString() const

Formats the path, reason, and optional suggestion as one message.

NameDescription
CodeIdentifies the validation failure represented by a ConfigError.

enum Code

Identifies the validation failure represented by a ConfigError.

ValueDescription
ParserErrorThe INI file could not be read or parsed.
MissingRequiredSectionA schema-declared required section is absent.
MissingRequiredPropertyA required property is absent from a present section.
UnknownSectionThe configuration contains a section not declared by the schema.
UnknownPropertyThe configuration contains a property not declared in its section.
ConversionErrorA source value cannot be converted to its declared type.
SchemaErrorThe fluent schema declaration API was used in an invalid order.
RangeErrorA converted value is outside its declared range.
ValidatorErrorA custom validator rejected a converted value.