hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
assert_config.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_CLI_ASSERT_CONFIG_HPP
7 #define IROHA_CLI_ASSERT_CONFIG_HPP
8 
9 #include <stdexcept>
10 #include <string>
11 
12 namespace assert_config {
16  inline std::string no_member_error(std::string const &member) {
17  return "No member '" + member + "'";
18  }
19 
20  inline std::string type_error(std::string const &value,
21  std::string const &type) {
22  return "'" + value + "' is not " + type;
23  }
24 
25  inline std::string parse_error(std::string const &path) {
26  return "Parse error. JSON file path: " + path + "'";
27  }
28 
33  inline void fatal_error(std::string const &error) {
34  throw std::runtime_error(error);
35  }
36 
42  inline void assert_fatal(bool condition, std::string const &error) {
43  if (!condition) {
44  fatal_error(error);
45  }
46  }
47 } // namespace assert_config
48 
49 #endif // IROHA_CLI_ASSERT_CONFIG_HPP
void assert_fatal(bool condition, std::string const &error)
Definition: assert_config.hpp:42
Definition: assert_config.hpp:12
std::string no_member_error(std::string const &member)
Definition: assert_config.hpp:16
std::string type_error(std::string const &value, std::string const &type)
Definition: assert_config.hpp:20
string(REPLACE".""/"CMAKE_SWIG_OUTDIR ${SWIG_JAVA_PKG}) else() set(CMAKE_SWIG_FLAGS"") endif() myswig_add_library(irohajava LANGUAGE java SOURCES bindings.i) unset(CMAKE_SWIG_FLAGS) swig_link_libraries(irohajava $
Definition: CMakeLists.txt:54
void fatal_error(std::string const &error)
Definition: assert_config.hpp:33
std::string parse_error(std::string const &path)
Definition: assert_config.hpp:25