aboutsummaryrefslogtreecommitdiffstats
path: root/liblfjail/generic_error.hh
blob: 63c16134c373ff6ca2270b83178227dec4aed34f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*
 * This source code is released into the public domain.
 */

#ifndef	LFJAIL_GENERIC_ERROR_HH
#define	LFJAIL_GENERIC_ERROR_HH

#include <format>
#include <stdexcept>

namespace lfjail {

struct generic_error : std::runtime_error {
	template<typename... Args>
	generic_error(std::format_string<Args...> fmt, Args &&...args)
		: std::runtime_error(std::format(fmt, std::forward<Args>(args)...))
	{}
};

} // namespace lfjail

#endif	// !LFJAIL_GENERIC_ERROR_HH