mirror of
https://github.com/PancakeTAS/lsfg-vk.git
synced 2025-10-30 07:01:10 +00:00
45 lines
1.1 KiB
C++
45 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include <vulkan/vulkan_core.h>
|
|
|
|
#include <stdexcept>
|
|
#include <string>
|
|
|
|
namespace LSFG {
|
|
|
|
/// Simple exception class for stacking errors.
|
|
class error : public std::runtime_error {
|
|
public:
|
|
///
|
|
/// Construct a new error with a message.
|
|
///
|
|
/// @param message The error message.
|
|
///
|
|
explicit error(const std::string& message);
|
|
|
|
///
|
|
/// Construct a new error with a message.
|
|
///
|
|
/// @param message The error message.
|
|
/// @param exe The original exception to rethrow.
|
|
///
|
|
explicit error(const std::string& message,
|
|
const std::exception& exe);
|
|
|
|
/// Get the exception as a string.
|
|
[[nodiscard]] const char* what() const noexcept override {
|
|
return message.c_str();
|
|
}
|
|
|
|
// Trivially copyable, moveable and destructible
|
|
error(const error&) = default;
|
|
error(error&&) = default;
|
|
error& operator=(const error&) = default;
|
|
error& operator=(error&&) = default;
|
|
~error() noexcept override;
|
|
private:
|
|
std::string message;
|
|
};
|
|
|
|
|
|
}
|