0.6.0
C++ to UML diagram generator based on Clang
Loading...
Searching...
No Matches
Classes | Functions
clanguml::error Namespace Reference

Classes

class  compilation_database_error
 
class  config_schema_error
 
class  diagram_generation_error
 
class  empty_diagram_error
 
class  invalid_sequence_from_condition
 
class  invalid_sequence_to_condition
 
class  query_driver_no_paths
 
struct  uml_alias_missing
 

Functions

void print (std::ostream &ostr, const config_schema_error &e, logging::logger_type_t logger_type)
 
std::string to_string (miroir::ErrorType et)
 

Function Documentation

◆ print()

void clanguml::error::print ( std::ostream &  ostr,
const config_schema_error e,
logging::logger_type_t  logger_type 
)

Definition at line 48 of file yaml_decoders.cc.

50{
51 if (logger_type == logging::logger_type_t::text) {
52 ostr << "ERROR: Invalid schema:\n";
53 for (const auto &schema_error : e.errors) {
54 std::cout << " - " << schema_error.description() << '\n';
55 }
56 }
57 else {
58 inja::json j;
59 j["valid"] = false;
60 j["errors"] = inja::json::array();
61 for (const auto &schema_error : e.errors) {
62 inja::json je;
63 je["path"] = schema_error.path;
64 je["error_type"] = to_string(schema_error.type);
65 je["description"] = schema_error.description();
66 j["errors"].emplace_back(std::move(je));
67 }
68 ostr << j.dump();
69 }
70}

◆ to_string()

std::string clanguml::error::to_string ( miroir::ErrorType  et)

Definition at line 30 of file yaml_decoders.cc.

31{
32 switch (et) {
33 case miroir::ErrorType::NodeNotFound:
34 return "NodeNotFound";
35 case miroir::ErrorType::InvalidValueType:
36 return "InvalidValueType";
37 case miroir::ErrorType::InvalidValue:
38 return "InvalidValue";
39 case miroir::ErrorType::MissingKeyWithType:
40 return "MissingKeyWithType";
41 case miroir::ErrorType::UndefinedNode:
42 return "UndefinedNode";
43 default:
44 return "";
45 }
46}