13#include <kernel/util/string.hpp>
53 const char*
const function,
54 const char*
const file,
56 const String & message_in) :
79 virtual const char *
what() const noexcept
override
105 Exception(
"Internal error: " + message_in)
118 const char*
const function,
119 const char*
const file,
121 const String & message_in) :
122 Exception(function, file, line,
"Internal error: " + message_in)
158 Exception(
"ParseError: " + name +
": expected " + expect +
" but got '" + got +
"'")
206 FileError(
"File not found: '" + filename +
"'")
231 FileError(
"Could not create file: '" + filename +
"'")
268 Exception(message_in + (filename.empty() ?
"":
" in file " + filename)),
Exception(const Exception &)
copy CTOR
const String _message
descriptive error message
virtual ~Exception() noexcept
DTOR.
Exception(const char *const function, const char *const file, const long line, const String &message_in)
CTOR.
virtual const char * what() const noexcept override
return descriptive exception name
const String message() const
returns error message
Exception(const String &message_in)
CTOR.
Base class for file related errors.
FileError(const String &message_in)
Constructor.
File-Not-Created exception.
FileNotCreated(const String &filename)
Constructor.
File-Not-Found exception.
FileNotFound(const String &filename)
Constructor.
exception that is thrown if something that is never supposed to happen happens
InternalError(const char *const function, const char *const file, const long line, const String &message_in)
Constructor.
InternalError(const String &message_in)
Constructor.
Class for parser related errors.
ParseError(const String &message_in)
Constructor.
ParseError(const String &name, const String &got, const String &expect)
Constructor.
String class implementation.
Syntax Error exception class.
String _filename
name of the file containing the syntax error
virtual ~SyntaxError() noexcept
virtual destructor
SyntaxError(String message_in, String filename="")
Constructor.
String get_filename() const
returns the filename
String stringify(const T_ &item)
Converts an item into a String.