3#include <StormByte/exception.hxx>
4#include <StormByte/database/visibility.h>
10namespace StormByte::Database {
15 class STORMBYTE_DATABASE_PUBLIC
Exception:
public StormByte::Exception {
17 template <
typename... Args>
18 Exception(
const std::string& component, std::format_string<Args...> fmt, Args&&... args):
19 StormByte::Exception(
"Database::" + component, fmt, std::forward<Args>(args)...) {}
21 using StormByte::Exception::Exception;
38 using Exception::Exception;
47 template <
typename... Args>
48 WrongValueType(
const std::string& component, std::format_string<Args...> fmt, Args&&... args):
49 Exception(
"WrongValueType: ", fmt, std::forward<Args>(args)...) {}
51 using Exception::Exception;
60 template <
typename... Args>
62 Exception(
"ColumnNotFound: ",
"Column '{}' not found", collumn) {}
64 using Exception::Exception;
74 Exception(
"OutOfBounds: ",
"Position {} is out of bounds for size {}", pos, size) {}
76 using Exception::Exception;
85 template <
typename... Args>
86 QueryException(
const std::string& component, std::format_string<Args...> fmt, Args&&... args):
87 Exception(
"Query::" + component, fmt, std::forward<Args>(args)...) {}
89 using Exception::Exception;
99 QueryException(
"PreparedSTMT: ",
"Statement '{}' not found", name) {}
101 using QueryException::QueryException;
111 QueryException(
"Execute: ",
"Error executing query: {}", error) {}
113 using QueryException::QueryException;
Exception when accessing a not found column.
Definition exception.hxx:58
Definition exception.hxx:33
Base class for Database exceptions.
Definition exception.hxx:15
virtual ~Exception() noexcept override=default
Exception when executing a query.
Definition exception.hxx:108
Exception when accessing an out of bounds column.
Definition exception.hxx:71
Exception related to query execution.
Definition exception.hxx:83
Exception when accessing an unknown prepared statement.
Definition exception.hxx:96
Exception thrown when value type requested is not correct.
Definition exception.hxx:45