Exceptions.h
1 #pragma once
2 
3 #include "stormancer/BuildConfig.h"
4 
5 #include <exception>
6 #include <stdexcept>
7 #include <string>
8 
9 namespace Stormancer
10 {
11  class PointerDeletedException : public std::exception
12  {
13  public:
14 
16  : _message("pointer_deleted")
17  {
18  }
19 
20  PointerDeletedException(const std::string& message)
21  : _message(message.c_str())
22  {
23  }
24 
25  PointerDeletedException(const char* message)
26  : _message(message)
27  {
28  }
29 
30  const char* what() const noexcept override
31  {
32  return _message.c_str();
33  }
34 
35  private:
36 
37  std::string _message;
38  };
39 
40  // This class does not inherit from runtime_error because of the issues we had with it on unreal and PS4
41  class DependencyResolutionException : public std::exception
42  {
43  public:
44 
45  DependencyResolutionException(const std::string& message)
46  : _message(message)
47  {
48  }
49 
50  DependencyResolutionException(const char* message)
51  : _message(message)
52  {
53  }
54 
55  const char* what() const noexcept override
56  {
57  return _message.c_str();
58  }
59 
60  private:
61 
62  std::string _message;
63  };
64 }
Definition: Exceptions.h:11