StormByte C++ Library: Database module 0.0.9999
StormByte-Database is a StormByte library module for handling database connections
Loading...
Searching...
No Matches
exception.hxx
1#pragma once
2
3#include <StormByte/database/sqlite/type.hxx>
4#include <StormByte/exception.hxx>
5
10namespace StormByte::Database::SQLite {
15 class STORMBYTE_DATABASE_PUBLIC Exception: public StormByte::Exception {
16 public:
21 Exception(const std::string& message);
22
26 Exception(const Exception&) = default;
27
31 Exception(Exception&&) noexcept = default;
32
36 Exception& operator=(const Exception&) = default;
37
41 Exception& operator=(Exception&&) noexcept = default;
42
46 virtual ~Exception() noexcept override = default;
47 };
48
53 class STORMBYTE_DATABASE_PUBLIC WrongResultType: public Exception {
54 public:
60 WrongResultType(const Type& source_type, const Type& asked_type);
61
66
70 WrongResultType(WrongResultType&&) noexcept = default;
71
75 WrongResultType& operator=(const WrongResultType&) = default;
76
80 WrongResultType& operator=(WrongResultType&&) noexcept = default;
81
85 ~WrongResultType() noexcept override = default;
86 };
87
92 class STORMBYTE_DATABASE_PUBLIC ConnectionError: public Exception {
93 public:
98 ConnectionError(const std::string& reason);
99
104 ConnectionError(std::string&& reason);
105
110
114 ConnectionError(ConnectionError&&) noexcept = default;
115
119 ConnectionError& operator=(const ConnectionError&) = default;
120
124 ConnectionError& operator=(ConnectionError&&) noexcept = default;
125
129 ~ConnectionError() noexcept override = default;
130 };
131
136 class STORMBYTE_DATABASE_PUBLIC QueryError: public Exception {
137 public:
142 QueryError(const std::string& reason);
143
148 QueryError(std::string&& reason);
149
153 QueryError(const QueryError&) = default;
154
158 QueryError(QueryError&&) noexcept = default;
159
163 QueryError& operator=(const QueryError&) = default;
164
168 QueryError& operator=(QueryError&&) noexcept = default;
169
173 ~QueryError() noexcept override = default;
174 };
175}
Exception for connection error.
Definition exception.hxx:92
ConnectionError(const std::string &reason)
ConnectionError(const ConnectionError &)=default
ConnectionError(ConnectionError &&) noexcept=default
Exception base class for SQLite.
Definition exception.hxx:15
Exception(const std::string &message)
Exception(const Exception &)=default
Exception(Exception &&) noexcept=default
Exception for query error.
Definition exception.hxx:136
QueryError(QueryError &&) noexcept=default
QueryError(const std::string &reason)
QueryError(const QueryError &)=default
Exception for wrong result type.
Definition exception.hxx:53
WrongResultType(WrongResultType &&) noexcept=default
WrongResultType(const Type &source_type, const Type &asked_type)
WrongResultType(const WrongResultType &)=default