Skip to content

iris::build::BuildError Class Reference

Doxygen 1.15.0 generates this reference during each site build from the public headers. The C++ guide shows the API in use.

A mistake that SpecBuilder::build or SpecBuilder::source reports. More...

#include <iris/build.hpp>

Public Member Functions

BuildErrorKind kind () const
 Return what kind of mistake this is.
const std::string & message () const
 Return the message, without the code, line and call site of what().
const std::optional< Error > & language_error () const
 Return the language error, for BuildErrorKind::Spec.
const std::optional< std::string > & text () const
 Return the emitted text, for BuildErrorKind::Spec.
std::optional< std::string_view > emitted_line () const
 Return the line of the emitted text that the language error is on.
const std::optional< std::source_location > & call_site () const
 Return the host call that made the mistake, if it is known.

Detailed Description

A mistake that SpecBuilder::build or SpecBuilder::source reports.

A builder check names the host call that made the mistake. A language error from parsing the emitted text keeps the text and the error, and names the call that wrote the statement on the error's line.

Member Function Documentation

call_site()

const std::optional< std::source_location > & iris::build::BuildError::call_site ( ) const
inlinenodiscard

Return the host call that made the mistake, if it is known.

emitted_line()

std::optional< std::string_view > iris::build::BuildError::emitted_line ( ) const
nodiscard

Return the line of the emitted text that the language error is on.

kind()

BuildErrorKind iris::build::BuildError::kind ( ) const
inlinenodiscard

Return what kind of mistake this is.

language_error()

const std::optional< Error > & iris::build::BuildError::language_error ( ) const
inlinenodiscard

Return the language error, for BuildErrorKind::Spec.

message()

const std::string & iris::build::BuildError::message ( ) const
inlinenodiscard

Return the message, without the code, line and call site of what().

text()

const std::optional< std::string > & iris::build::BuildError::text ( ) const
inlinenodiscard

Return the emitted text, for BuildErrorKind::Spec.