-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathexceptions.hpp
More file actions
39 lines (32 loc) · 1.03 KB
/
Copy pathexceptions.hpp
File metadata and controls
39 lines (32 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/**
* Copyright (C) 2014 - 2019 Map2Check tool
* This file is part of the Map2Check tool, and is made available under
* the terms of the GNU General Public License version 2.
*
* SPDX-License-Identifier: (GPL-2.0)
**/
#ifndef MODULES_FRONTEND_EXCEPTIONS_HPP_
#define MODULES_FRONTEND_EXCEPTIONS_HPP_
#include <iostream>
#include <string>
using std::string;
namespace Map2Check::Exceptions {
class Map2CheckException : public runtime_error {
public:
explicit Map2CheckException(string message) : runtime_error(message) {}
virtual const char* what() const throw();
};
class ErrorOpeningFileException : public Map2CheckException {
public:
explicit ErrorOpeningFileException(string path)
: Map2CheckException("Could not open: " + path), path(path) {}
// virtual const char* what() const throw();
private:
string path;
};
class OutOfBounds : public Map2CheckException {
public:
OutOfBounds() : Map2CheckException("Index out of bounds") {}
};
} // namespace Map2Check::Exceptions
#endif // MODULES_FRONTEND_EXCEPTIONS_HPP_