Lightweight 0.20260303.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 /// Constructs the error with the name of the column type that failed to load.
19 explicit SqlRequireLoadedError(std::string_view columnType):
20 std::runtime_error(std::format("Could not load the data record: {}", columnType))
21 {
22 }
23};
24
25} // namespace Lightweight
Represents an error when a record is required to be loaded but is not.
Definition Error.hpp:16
SqlRequireLoadedError(std::string_view columnType)
Constructs the error with the name of the column type that failed to load.
Definition Error.hpp:19