Bomberman
RayError.hpp
Go to the documentation of this file.
1 /*
2 ** EPITECH PROJECT, 2021
3 ** Bomberman
4 ** File description:
5 ** RayError
6 */
7 
8 #ifndef RAYERROR_HPP_
9 #define RAYERROR_HPP_
10 
11 #include <stdexcept>
12 #include <string>
13 
14 namespace RAY::Exception {
16  class RayError: public std::runtime_error {
17  public:
19  RayError(const std::string &what);
20 
22  ~RayError() = default;
23 
25  RayError(const RayError &) = default;
26 
28  RayError &operator=(const RayError &) = default;
29  };
30 
32  class NotCompatibleError: public RayError {
33  public:
35  NotCompatibleError(const std::string &what);
36 
38  ~NotCompatibleError() = default;
39 
41  NotCompatibleError(const NotCompatibleError &) = default;
42 
45  };
46 
48  class NotSupportedError: public RayError {
49  public:
51  NotSupportedError(const std::string &what = "This operation is currently not supported");
52 
54  ~NotSupportedError() = default;
55 
57  NotSupportedError(const NotSupportedError &) = default;
58 
60  NotSupportedError &operator=(const NotSupportedError &) = default;
61  };
62 
63 
65  class WrongInputError: public RayError {
66  public:
68  explicit WrongInputError(const std::string &what = "The input can't be proceed");
69 
71  ~WrongInputError() override = default;
72 
74  WrongInputError(const WrongInputError &) = default;
75 
77  WrongInputError &operator=(const WrongInputError &) = default;
78  };
79 
81  class ResourceNotFound: public RayError {
82  public:
85  explicit ResourceNotFound(const std::string &path);
86 
88  ~ResourceNotFound() override = default;
89 
91  ResourceNotFound(const ResourceNotFound &) = default;
92 
94  ResourceNotFound &operator=(const ResourceNotFound &) = default;
95  };
96 }
97 
98 #endif /* !RAYERROR_HPP_ */
RAY::Exception::NotSupportedError::~NotSupportedError
~NotSupportedError()=default
A default destructor.
RAY::Exception::NotSupportedError
exception used when an non-supported operation is done
Definition: RayError.hpp:48
RAY::Exception::WrongInputError::operator=
WrongInputError & operator=(const WrongInputError &)=default
A default assignment operator.
RAY::Exception::NotCompatibleError
exception used when an incompatibility occurs
Definition: RayError.hpp:32
RAY::Exception::RayError::RayError
RayError(const std::string &what)
Create a new RAY exception.
Definition: RayError.cpp:10
RAY::Exception::ResourceNotFound::operator=
ResourceNotFound & operator=(const ResourceNotFound &)=default
A default assignment operator.
RAY::Exception::NotSupportedError::operator=
NotSupportedError & operator=(const NotSupportedError &)=default
A default assignment operator.
RAY::Exception::RayError::operator=
RayError & operator=(const RayError &)=default
A default assignment operator.
RAY::Exception::ResourceNotFound
exception used when a resource is not found
Definition: RayError.hpp:81
RAY::Exception::ResourceNotFound::ResourceNotFound
ResourceNotFound(const std::string &path)
Create a new exception instance.
Definition: RayError.cpp:30
RAY::Exception::WrongInputError
exception used when an non-supported operation is done
Definition: RayError.hpp:65
RAY::Exception::RayError::~RayError
~RayError()=default
A default destructor.
RAY::Exception::WrongInputError::~WrongInputError
~WrongInputError() override=default
A default destructor.
RAY::Exception::RayError
base exception class for RAY lib
Definition: RayError.hpp:16
RAY::Exception::NotSupportedError::NotSupportedError
NotSupportedError(const std::string &what="This operation is currently not supported")
Create a new exception instance.
Definition: RayError.cpp:15
RAY::Exception::NotCompatibleError::operator=
NotCompatibleError & operator=(const NotCompatibleError &)=default
A default assignment operator.
RAY::Exception
Definition: RayError.hpp:14
RAY::Exception::NotCompatibleError::NotCompatibleError
NotCompatibleError(const std::string &what)
Create a new exception instance.
Definition: RayError.cpp:20
RAY::Exception::WrongInputError::WrongInputError
WrongInputError(const std::string &what="The input can't be proceed")
Create a new exception instance.
Definition: RayError.cpp:25
RAY::Exception::ResourceNotFound::~ResourceNotFound
~ResourceNotFound() override=default
A default destructor.
RAY::Exception::NotCompatibleError::~NotCompatibleError
~NotCompatibleError()=default
A default destructor.