Cafu Engine
Errors.hpp
1 /*
2 Cafu Engine, http://www.cafu.de/
3 Copyright (c) Carsten Fuchs and other contributors.
4 This project is licensed under the terms of the MIT license.
5 */
6 
7 #ifndef CAFU_MATH_ERRORS_HPP_INCLUDED
8 #define CAFU_MATH_ERRORS_HPP_INCLUDED
9 
10 #include <stdexcept>
11 
12 
13 /// General math error.
14 struct Math3DErrorE : public std::runtime_error
15 {
16  /// Constructor.
17  Math3DErrorE(const std::string& what_arg) : runtime_error(what_arg)
18  {
19  }
20 };
21 
22 
23 /// Division by zero error.
25 {
26  DivisionByZeroE() : Math3DErrorE("Division by 0.")
27  {
28  }
29 };
30 
31 
32 /// Invalid operation (invalid use of method, etc.).
34 {
35  InvalidOperationE() : Math3DErrorE("Invalid operation.")
36  {
37  }
38 };
39 
40 #endif
General math error.
Definition: Errors.hpp:14
Math3DErrorE(const std::string &what_arg)
Constructor.
Definition: Errors.hpp:17
Invalid operation (invalid use of method, etc.).
Definition: Errors.hpp:33
Division by zero error.
Definition: Errors.hpp:24