1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-05 15:55:45 +00:00
OpenMW/components/compiler/exception.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

37 lines
842 B
C++
Raw Normal View History

2010-07-01 15:41:06 +00:00
#ifndef COMPILER_EXCEPTION_H_INCLUDED
#define COMPILER_EXCEPTION_H_INCLUDED
#include <exception>
namespace Compiler
{
/// \brief Exception: Error while parsing the source
2010-06-27 17:20:21 +00:00
class SourceException : public std::exception
2010-07-01 15:41:06 +00:00
{
2022-09-22 18:26:05 +00:00
public:
const char* what() const noexcept override { return "Compile error"; }
///< Return error message
2010-06-27 17:20:21 +00:00
};
2010-07-01 15:41:06 +00:00
/// \brief Exception: File error
2010-06-28 09:38:21 +00:00
class FileException : public SourceException
2010-06-27 17:20:21 +00:00
{
2022-09-22 18:26:05 +00:00
public:
const char* what() const noexcept override { return "Can't read file"; }
///< Return error message
2010-06-27 17:20:21 +00:00
};
2010-07-01 15:41:06 +00:00
/// \brief Exception: EOF condition encountered
2010-06-28 09:38:21 +00:00
class EOFException : public SourceException
{
2022-09-22 18:26:05 +00:00
public:
const char* what() const noexcept override { return "End of file"; }
///< Return error message
2010-06-27 17:20:21 +00:00
};
2010-07-01 15:41:06 +00:00
}
#endif