2021-07-30 20:41:47 +02:00
|
|
|
#ifndef BWIDGETS_EXCEPTION_HPP
|
|
|
|
#define BWIDGETS_EXCEPTION_HPP
|
2021-07-18 18:26:12 +02:00
|
|
|
|
2021-08-14 16:45:30 +02:00
|
|
|
#include <stdexcept>
|
2021-07-18 18:26:12 +02:00
|
|
|
|
|
|
|
#include <basic_widgets/core/type/concepts.hpp>
|
|
|
|
|
2021-08-06 14:22:56 +02:00
|
|
|
namespace bwidgets
|
2021-07-18 18:26:12 +02:00
|
|
|
{
|
2021-08-23 23:50:14 +02:00
|
|
|
// Base type for custom runtime errors.
|
|
|
|
class BaseException : std::runtime_error
|
2021-07-18 18:26:12 +02:00
|
|
|
{
|
2021-08-23 23:50:14 +02:00
|
|
|
protected:
|
2021-08-14 11:04:48 +02:00
|
|
|
using runtime_error::runtime_error;
|
2021-07-18 18:26:12 +02:00
|
|
|
};
|
|
|
|
|
2021-08-23 23:50:14 +02:00
|
|
|
// T derives from BaseException.
|
2021-07-18 18:26:12 +02:00
|
|
|
template<typename T>
|
|
|
|
concept Exception = std::derived_from<T, BaseException>;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|