CCF
Loading...
Searching...
No Matches
ccf_exception.h
Go to the documentation of this file.
1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the Apache 2.0 License.
3#pragma once
4
5#include "ccf/ds/logger.h"
6
7#include <exception>
8#include <string>
9
10namespace ccf
11{
12 class ccf_logic_error : public std::exception
13 {
14 public:
15 ccf_logic_error(const std::string& what_arg)
16 {
17 if (!what_arg.empty())
18 {
19 result.append(what_arg.c_str());
20 result.append("\n");
21 }
22 }
23
25
26 const char* what() const throw() override
27 {
28 return result.c_str();
29 }
30
31 private:
32 std::string result;
33 };
34
36 {
37 public:
38 ccf_openssl_rdrand_init_error(const std::string& what_arg) :
39 ccf_logic_error(what_arg)
40 {}
41 };
42};
Definition ccf_exception.h:13
const char * what() const override
Definition ccf_exception.h:26
ccf_logic_error()
Definition ccf_exception.h:24
ccf_logic_error(const std::string &what_arg)
Definition ccf_exception.h:15
Definition ccf_exception.h:36
ccf_openssl_rdrand_init_error(const std::string &what_arg)
Definition ccf_exception.h:38
Definition app_interface.h:14