uvco 0.1
Loading...
Searching...
No Matches
exception.h
Go to the documentation of this file.
1#pragma once
2
4
5#include <exception>
6#include <optional>
7#include <string>
8#include <string_view>
9
10namespace uvco {
11
15
19struct UvcoException : public std::exception {
20 explicit UvcoException(std::string message) noexcept;
21 UvcoException(uv_status status, std::string_view where) noexcept;
22 UvcoException &operator=(const UvcoException &) noexcept = default;
23 UvcoException &operator=(UvcoException &&) noexcept = default;
24 UvcoException(const UvcoException &) noexcept = default;
25 UvcoException(UvcoException &&) noexcept = default;
26 ~UvcoException() noexcept override = default;
27
29 [[nodiscard]] const char *what() const noexcept override;
30
32 explicit operator std::string() const;
33
35 std::string message;
38 std::optional<uv_status> status;
39};
40
42
43} // namespace uvco
int uv_status
Result of a libuv operation, an errno error code.
Definition internal_utils.h:22
Definition async_work.cc:17
Definition exception.h:19
UvcoException(std::string message) noexcept
Definition exception.cc:14
UvcoException & operator=(const UvcoException &) noexcept=default
const char * what() const noexcept override
Provide information about the error.
Definition exception.cc:21
std::string message
The error message.
Definition exception.h:35
std::optional< uv_status > status
Definition exception.h:38
UvcoException & operator=(UvcoException &&) noexcept=default