Lightweight 0.20250904.0
Loading...
Searching...
No Matches
Error.hpp
1// SPDX-License-Identifier: Apache-2.0
2
3#pragma once
4
5#include <format>
6#include <stdexcept>
7#include <string_view>
8
9namespace Lightweight
10{
11
12/// @brief Represents an error when a record is required to be loaded but is not.
13///
14/// @ingroup DataMapper
15class SqlRequireLoadedError: public std::runtime_error
16{
17 public:
18 explicit SqlRequireLoadedError(std::string_view columnType):
19 std::runtime_error(std::format("Could not load the data record: {}", columnType))
20 {
21 }
22};
23
24} // namespace Lightweight
Represents an error when a record is required to be loaded but is not.
Definition Error.hpp:16