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/exception.hxx>
4#include <StormByte/database/visibility.h>
5
10namespace StormByte::Database {
15 class STORMBYTE_DATABASE_PUBLIC Exception: public StormByte::Exception {
16 public:
21 Exception(const std::string& reason);
22
27 Exception(std::string&& reason);
28
32 Exception(const Exception&) = default;
33
37 Exception(Exception&&) noexcept = default;
38
42 Exception& operator=(const Exception&) = default;
43
47 Exception& operator=(Exception&&) noexcept = default;
48
52 virtual ~Exception() noexcept = default;
53 };
54
59 class STORMBYTE_DATABASE_PUBLIC WrongValueType final: public Exception {
60 public:
65 WrongValueType(const std::string& targettype);
66
70 WrongValueType(const WrongValueType&) = default;
71
76
81
86
90 ~WrongValueType() noexcept override = default;
91 };
92
97 class STORMBYTE_DATABASE_PUBLIC ColumnNotFound: public Exception {
98 public:
103 ColumnNotFound(const std::string& name);
104
109
113 ColumnNotFound(ColumnNotFound&&) noexcept = default;
114
118 ColumnNotFound& operator=(const ColumnNotFound&) = default;
119
123 ColumnNotFound& operator=(ColumnNotFound&&) noexcept = default;
124
128 ~ColumnNotFound() noexcept override = default;
129 };
130
135 class STORMBYTE_DATABASE_PUBLIC OutOfBounds: public Exception {
136 public:
141 OutOfBounds(const size_t& index);
142
146 OutOfBounds(const OutOfBounds&) = default;
147
151 OutOfBounds(OutOfBounds&&) noexcept = default;
152
156 OutOfBounds& operator=(const OutOfBounds&) = default;
157
161 OutOfBounds& operator=(OutOfBounds&&) noexcept = default;
162
166 ~OutOfBounds() noexcept override = default;
167 };
168}
Exception when accessing a not found column.
Definition exception.hxx:97
ColumnNotFound(const std::string &name)
ColumnNotFound(const ColumnNotFound &)=default
ColumnNotFound(ColumnNotFound &&) noexcept=default
Base class for Database exceptions.
Definition exception.hxx:15
Exception(const Exception &)=default
Exception(std::string &&reason)
Exception(Exception &&) noexcept=default
Exception(const std::string &reason)
Exception when accessing an out of bounds column.
Definition exception.hxx:135
OutOfBounds(const size_t &index)
OutOfBounds(const OutOfBounds &)=default
OutOfBounds(OutOfBounds &&) noexcept=default
Exception thrown when value type requested is not correct.
Definition exception.hxx:59
~WrongValueType() noexcept override=default
WrongValueType & operator=(WrongValueType &&)=default
WrongValueType & operator=(const WrongValueType &)=default
WrongValueType(const WrongValueType &)=default
WrongValueType(WrongValueType &&)=default
WrongValueType(const std::string &targettype)