Exceptions
Shared exception types and source-location information.
-
enum class snt::core::DiagnosticSeverity
Values:
-
enumerator Info
-
enumerator Warning
-
enumerator Error
-
enumerator Info
-
struct Diagnostic
- #include <diagnostic.h>
Structured diagnostic for CLI, tests, and interactive clients.
Public Members
-
DiagnosticSeverity severity
-
std::string code
Stable category, such as “dip.syntax”.
-
std::string message
-
std::string details
-
std::string suggestion
-
std::optional<std::string> node_path
-
std::optional<SourceLocation> location
User input location, when known.
-
std::optional<SourceLocation> origin
Implementation location, when known.
-
DiagnosticSeverity severity
-
class Exception : public snt::core::ExceptionBase<ExceptionInfo>
- #include <exceptions.h>
Base exception type for errors raised by the core library.
Subclassed by snt::api::Exception, snt::core::MissingException, snt::core::ParserException, snt::exs::Exception, snt::mat::Exception, snt::puq::Exception, snt::val::Exception
Public Functions
-
inline Exception(std::string message, std::string details, std::string suggestion, std::string origin_file, size_t origin_line)
Construct an exception with message, details, suggestion, and source location.
-
inline Exception(std::string message, std::string details, std::string suggestion, std::string origin_file, size_t origin_line)
-
template<typename E>
class ExceptionBase : public std::runtime_error - #include <exceptions.h>
-
struct ExceptionInfo
- #include <exceptions.h>
Structured information carried by an SNT exception.
Subclassed by snt::dip::ExceptionInfo
-
class MissingException : public snt::core::Exception
- #include <exceptions.h>
Missing exception is triggered when functionality is not implemented yet Exception raised when requested functionality is unavailable.
Public Functions
-
inline MissingException(std::string message, std::string file, std::size_t line)
Construct an exception identifying unavailable functionality.
-
inline MissingException(std::string message, std::string file, std::size_t line)
-
class ParserException : public snt::core::Exception
- #include <exceptions.h>
Parse exceptions are triggered during parsing Exception raised while parsing input.
-
struct SourceLocation
- #include <exceptions.h>
Source location associated with a diagnostic.