Capsule API Example

Loading...
Searching...
No Matches
ClientException.hpp
Go to the documentation of this file.
1// Copyright. 2019 - 2024 PSBD. All rights reserved.
2
3#pragma once
4
5#include <stdexcept>
6#include <string>
7
8 namespace capsule::client {
12 class ClientException : public std::runtime_error {
13 std::string m_reason = "Client exception: ";
14
15 public:
16 explicit ClientException(std::string_view exceptionReason) noexcept
17 : runtime_error(exceptionReason.data()) {
18 m_reason.append(exceptionReason);
19 }
20
21 const char* what() const noexcept override {
22 return m_reason.c_str();
23 }
24};
25} // namespace capsule::client
capsule::client::ClientException
Definition ClientException.hpp:12
capsule::client::ClientException::what
const char * what() const noexcept override
Definition ClientException.hpp:21
capsule::client::ClientException::ClientException
ClientException(std::string_view exceptionReason) noexcept
Definition ClientException.hpp:16
capsule::client
Definition Classification.hpp:7