-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathErrors.h
More file actions
28 lines (23 loc) · 792 Bytes
/
Copy pathErrors.h
File metadata and controls
28 lines (23 loc) · 792 Bytes
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
#ifndef ERRORS_H
#define ERRORS_H
// This file defines some useful exception classes.
// These are subclasses that inherit from std::runtime_error.
// The important thing is that there's one type per type of error, so
// you can write a separate catch statement for each type of error.
// You can edit this file, but you shouldn't need to.
#include <stdexcept>
// Throw one of these when you can't parse a Move.
class ParseError: public std::runtime_error {
public:
ParseError(const std::string& message): std::runtime_error(message) {
// Nothing else to do.
}
};
// Throw one of these when a Move is illegal.
class InvalidMove: public std::runtime_error {
public:
InvalidMove(const std::string& message): std::runtime_error(message) {
// Nothing else to do.
}
};
#endif