retdec
exceptions.h
Go to the documentation of this file.
1 
7 #ifndef RETDEC_LLVMIR_EMUL_EXCEPTIONS_H
8 #define RETDEC_LLVMIR_EMUL_EXCEPTIONS_H
9 
10 #include <cassert>
11 #include <sstream>
12 #include <stdexcept>
13 
14 namespace retdec {
15 namespace llvmir_emul {
16 
20 class LlvmIrEmulatorBaseError : public std::exception
21 {
22  public:
23  virtual ~LlvmIrEmulatorBaseError() = default;
24 };
25 
30 {
31  public:
32  LlvmIrEmulatorError(const std::string& message) :
33  _whatMessage(message)
34  {
35  assert(false);
36  }
37 
38  virtual const char* what() const noexcept override
39  {
40  return _whatMessage.c_str();
41  }
42 
43  private:
45  std::string _whatMessage;
46 };
47 
48 } // llvmir_emul
49 } // retdec
50 
51 #endif
Definition: exceptions.h:30
LlvmIrEmulatorError(const std::string &message)
Definition: exceptions.h:32
virtual const char * what() const noexcept override
Definition: exceptions.h:38
std::string _whatMessage
Message returned by what() method.
Definition: exceptions.h:45
Definition: archive_wrapper.h:19