Cytopia  0.3
A city building simulation game
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Exception.hxx
Go to the documentation of this file.
1 #ifndef EXCEPTION_HXX_
2 #define EXCEPTION_HXX_
3 
4 #include <stdexcept>
5 #include <exception>
6 
7 #define ERROR_MSG "In file " __BOLD__ __RED__ __FILE__ ":" __line__ __CLEAR__ "\n\t"
8 #define NESTED_MSG "Called from " __BOLD__ __RED__ __FILE__ ":" __line__ __CLEAR__ "\n\t"
9 #define STRINGIFY(x) #x
10 #define STRINGIFY2(x) STRINGIFY(x)
11 #define __line__ STRINGIFY2(__LINE__)
12 #define TRACE_INFO "Exception thrown from " + string(__PRETTY_FUNCTION__) + " at " __FILE__ ":" __line__ " - "
13 
14 // Required to use std::getenv without warning on MSVC
15 #define _CRT_SECURE_NO_WARNINGS
16 
17 #if _MSC_VER && !__INTEL_COMPILER
18 #define __PRETTY_FUNCTION__ __FUNCSIG__
19 #elif __INTEL_COMPILER
20 #define __PRETTY_FUNCTION__ "Unknown_Method"
21 #endif
22 
23 using RuntimeError = std::runtime_error;
24 
28 class CytopiaError : public RuntimeError
29 {
31 };
32 
37 {
38  using CytopiaError::CytopiaError;
39 };
40 
45 {
46  using CytopiaError::CytopiaError;
47 };
48 
52 class AudioError : public CytopiaError
53 {
54  using CytopiaError::CytopiaError;
55 };
56 
60 class FontError : public CytopiaError
61 {
62  using CytopiaError::CytopiaError;
63 };
64 
68 class DisplayError : public CytopiaError
69 {
70  using CytopiaError::CytopiaError;
71 };
72 
76 class UIError : public CytopiaError
77 {
78  using CytopiaError::CytopiaError;
79 };
80 
85 {
86  using CytopiaError::CytopiaError;
87 };
88 
93 
94 #endif
ConfigurationError
A configuration error.
Definition: Exception.hxx:36
UIError
A UI-related error occured.
Definition: Exception.hxx:76
CompressionError
A compression error occured.
Definition: Exception.hxx:84
systemSetupCrashHandler
void systemSetupCrashHandler()
install OS crash handler
Definition: Exception.cxx:206
RuntimeError
std::runtime_error RuntimeError
Definition: Game.hxx:20
FontError
A font-related error occured.
Definition: Exception.hxx:60
UnimplementedError
An unimplemented function was called.
Definition: Exception.hxx:44
RuntimeError
std::runtime_error RuntimeError
Definition: Exception.hxx:23
DisplayError
A display error occured.
Definition: Exception.hxx:68
AudioError
An audio-related error occured.
Definition: Exception.hxx:52
CytopiaError
A generic error in Cytopia.
Definition: Exception.hxx:28