Panic.hpp
Go to the documentation of this file.
1 
33 #ifndef LVR2_UTIL_PANIC_H_
34 #define LVR2_UTIL_PANIC_H_
35 
36 #include <exception>
37 #include <iostream>
38 #include <string>
39 
40 namespace lvr2
41 {
42 
46 struct PanicException : public std::exception
47 {
48  PanicException(std::string msg) : m_msg(msg) {}
49 
50  virtual const char* what() const noexcept
51  {
52  return m_msg.c_str();
53  }
54 
55 private:
56  std::string m_msg;
57 };
58 
59 
60 struct VertexLoopException : public std::exception
61 {
62  VertexLoopException(std::string msg) : m_msg(msg) {}
63 
64  virtual const char* what() const noexcept
65  {
66  return m_msg.c_str();
67  }
68 private:
69  std::string m_msg;
70 };
71 
75 inline void panic(std::string msg)
76 {
77  throw PanicException("Program panicked: " + msg);
78 }
79 
84 inline void panic_unimplemented(std::string msg)
85 {
86  throw PanicException("Program panicked due to missing implementation: " + msg);
87 }
88 
89 
90 } // namespace lvr2
91 
92 
93 #endif // LVR2_UTIL_PANIC_H_
lvr2::PanicException
An exception denoting an internal bug.
Definition: Panic.hpp:46
lvr2::VertexLoopException
Definition: Panic.hpp:60
lvr2::VertexLoopException::m_msg
std::string m_msg
Definition: Panic.hpp:69
lvr2::panic
void panic(std::string msg)
Throws a panic exception with the given error message.
Definition: Panic.hpp:75
lvr2::VertexLoopException::VertexLoopException
VertexLoopException(std::string msg)
Definition: Panic.hpp:62
lvr2::panic_unimplemented
void panic_unimplemented(std::string msg)
Throws a panic exception with the given error message and denotes that the exception was thrown due t...
Definition: Panic.hpp:84
lvr2
Definition: BaseBufferManipulators.hpp:39
lvr2::PanicException::m_msg
std::string m_msg
Definition: Panic.hpp:56
lvr2::PanicException::what
virtual const char * what() const noexcept
Definition: Panic.hpp:50
lvr2::PanicException::PanicException
PanicException(std::string msg)
Definition: Panic.hpp:48
lvr2::VertexLoopException::what
virtual const char * what() const noexcept
Definition: Panic.hpp:64


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Wed Mar 2 2022 00:37:24