Zth (libzth)
Loading...
Searching...
No Matches
exception.h
Go to the documentation of this file.
1#ifndef ZTH_EXCEPTION_H
2#define ZTH_EXCEPTION_H
3/*
4 * SPDX-FileCopyrightText: 2019-2026 Jochem Rutgers
5 *
6 * SPDX-License-Identifier: MPL-2.0
7 */
8
9#ifdef __cplusplus
10
11namespace zth {
12
16struct exception {};
17
21struct not_in_fiber : public exception {};
22
26struct fiber_already_dead : public exception {};
27
31struct coro_invalid_state : public exception {};
32
37
41struct errno_exception : public exception {
42 explicit errno_exception(int err) noexcept
43 : code(err)
44 {}
45
46 int code;
47};
48
49} // namespace zth
50
51#endif // __cplusplus
52#endif // ZTH_EXCEPTION_H
string err(int e)
Return a string like strerror() does, but as a zth::string.
Definition util.h:686
Exception thrown when a coroutine has already completed.
Definition exception.h:36
Exception thrown when an operation cannot be performed due to an invalid coroutine state.
Definition exception.h:31
Wrapper for an errno.
Definition exception.h:41
errno_exception(int err) noexcept
Definition exception.h:42
Base exception class for Zth exceptions.
Definition exception.h:16
Exception thrown when an operation cannot be performed, as the fiber is already dead.
Definition exception.h:26
Exception thrown when an operation cannot be performed as there is no fiber context.
Definition exception.h:21