Console Library 8.0.0
A header-only library that makes C++ simple
Loading...
Searching...
No Matches
csexc.h
Go to the documentation of this file.
1
9
10/*
11Copyright (c) 2026 MrXie1109
12
13Permission is hereby granted, free of charge, to any person obtaining a copy
14of this software and associated documentation files (the "Software"), to deal
15in the Software without restriction, including without limitation the rights
16to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17copies of the Software, and to permit persons to whom the Software is
18furnished to do so, subject to the following conditions:
19
20The above copyright notice and this permission notice shall be included in all
21copies or substantial portions of the Software.
22
23THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29SOFTWARE.
30*/
31
32#pragma once
33#include <stdexcept>
34#include <string>
35
36namespace console {
42 class ConsoleError : public std::runtime_error {
43 public:
48 ConsoleError(const std::string &msg) : std::runtime_error(msg) {}
49 };
50
55 class FatalLogging : public ConsoleError {
56 public:
61 FatalLogging(const std::string &msg) : ConsoleError(msg) {}
62 };
63
68 class BadFormat : public ConsoleError {
69 public:
74 BadFormat(const std::string &msg) : ConsoleError(msg) {}
75 };
76
81 class FileError : public ConsoleError {
82 public:
87 FileError(const std::string &msg) : ConsoleError(msg) {}
88 };
89
96 class TypeError : public ConsoleError {
97 public:
102 TypeError(const std::string &msg) : ConsoleError(msg) {}
103 };
104
109 class ValueError : public ConsoleError {
110 public:
115 ValueError(const std::string &msg) : ConsoleError(msg) {}
116 };
117
122 public:
127 MultiArrayError(const std::string &msg) : ConsoleError(msg) {}
128 };
129
135 public:
140 ContainerError(const std::string &msg) : ConsoleError(msg) {}
141 };
142
147 class IndexError : public ConsoleError {
148 public:
153 IndexError(const std::string &msg) : ConsoleError(msg) {}
154 };
155
161 class DomainError : public ConsoleError {
162 public:
167 DomainError(const std::string &msg) : ConsoleError(msg) {}
168 };
169
175 public:
180 StopIteration(const std::string &msg) : ConsoleError(msg) {}
181 };
182
187 class AsyncError : public ConsoleError {
188 public:
193 AsyncError(const std::string &msg) : ConsoleError(msg) {}
194 };
195
200 class AssertError : public ConsoleError {
201 public:
206 AssertError(const std::string &msg) : ConsoleError(msg) {}
207 };
208}
AssertError(const std::string &msg)
构造 AssertError。
Definition csexc.h:206
AsyncError(const std::string &msg)
构造 ConsoleError。
Definition csexc.h:193
BadFormat(const std::string &msg)
构造 BadFormat。
Definition csexc.h:74
ConsoleError(const std::string &msg)
构造 ConsoleError。
Definition csexc.h:48
ContainerError(const std::string &msg)
构造 ContainerError。
Definition csexc.h:140
DomainError(const std::string &msg)
构造 DomainError。
Definition csexc.h:167
FatalLogging(const std::string &msg)
构造 FatalLogging。
Definition csexc.h:61
FileError(const std::string &msg)
构造 FileError。
Definition csexc.h:87
IndexError(const std::string &msg)
构造 IndexError。
Definition csexc.h:153
MultiArrayError(const std::string &msg)
构造 MultiArrayError。
Definition csexc.h:127
StopIteration(const std::string &msg)
构造 StopIteration。
Definition csexc.h:180
TypeError(const std::string &msg)
构造 TypeError。
Definition csexc.h:102
ValueError(const std::string &msg)
构造 ValueError。
Definition csexc.h:115
本库所有组件所在的顶层命名空间。