mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-06-05 19:04:26 +00:00
when a resource is not found, an exceptions is thrown
This commit is contained in:
@@ -26,3 +26,8 @@ RAY::Exception::WrongInputError::WrongInputError(const std::string &what):
|
||||
RayError(what)
|
||||
{
|
||||
}
|
||||
|
||||
RAY::Exception::ResourceNotFound::ResourceNotFound(const std::string &path):
|
||||
RayError("\033[36m" + path + "\033[31m couldn't be loaded\033[0m")
|
||||
{
|
||||
}
|
||||
|
||||
@@ -76,6 +76,23 @@ namespace RAY::Exception {
|
||||
//! @brief A default assignment operator
|
||||
WrongInputError &operator=(const WrongInputError &) = default;
|
||||
};
|
||||
|
||||
//! @brief exception used when a resource is not found
|
||||
class ResourceNotFound: public RayError {
|
||||
public:
|
||||
//! @brief Create a new exception instance
|
||||
//! @param path path of the un-loadable path
|
||||
explicit ResourceNotFound(const std::string &path);
|
||||
|
||||
//! @brief A default destructor
|
||||
~ResourceNotFound() override = default;
|
||||
|
||||
//! @brief An exception is copy constructable
|
||||
ResourceNotFound(const ResourceNotFound &) = default;
|
||||
|
||||
//! @brief A default assignment operator
|
||||
ResourceNotFound &operator=(const ResourceNotFound &) = default;
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* !RAYERROR_HPP_ */
|
||||
|
||||
Reference in New Issue
Block a user