diff options
author | Braden Bodily <thebodily@gmail.com> | 2019-08-14 20:57:49 -0600 |
---|---|---|
committer | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-08-17 12:33:15 +0200 |
commit | 71d71d55b5c0d6da4d1555823ac432bf0b33389a (patch) | |
tree | 20b2e819d599d6d1bd459bb51880c31e97cfe825 /editor/doc | |
parent | 40640a01dc90be00e55e4eef3c7800401ef63b18 (diff) |
Replace 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG' in 'core/' and 'editor/'
Condensed some if and ERR statements. Added dots to end of error messages
Couldn't figure out EXPLAINC. These files gave me trouble: core/error_macros.h, core/io/file_access_buffered_fa.h (where is it?),
core/os/memory.cpp,
drivers/png/png_driver_common.cpp,
drivers/xaudio2/audio_driver_xaudio2.cpp (where is it?)
Diffstat (limited to 'editor/doc')
-rw-r--r-- | editor/doc/doc_data.cpp | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/editor/doc/doc_data.cpp b/editor/doc/doc_data.cpp index 5b8c8fffb8..0f99e2ba1e 100644 --- a/editor/doc/doc_data.cpp +++ b/editor/doc/doc_data.cpp @@ -720,8 +720,7 @@ static Error _parse_methods(Ref<XMLParser> &parser, Vector<DocData::MethodDoc> & methods.push_back(method); } else { - ERR_EXPLAIN("Invalid tag in doc file: " + parser->get_node_name()); - ERR_FAIL_V(ERR_FILE_CORRUPT); + ERR_FAIL_V_MSG(ERR_FILE_CORRUPT, "Invalid tag in doc file: " + parser->get_node_name() + "."); } } else if (parser->get_node_type() == XMLParser::NODE_ELEMENT_END && parser->get_node_name() == section) @@ -841,8 +840,7 @@ Error DocData::_load(Ref<XMLParser> parser) { if (parser->get_node_type() == XMLParser::NODE_TEXT) c.tutorials.push_back(parser->get_node_data().strip_edges()); } else { - ERR_EXPLAIN("Invalid tag in doc file: " + name3); - ERR_FAIL_V(ERR_FILE_CORRUPT); + ERR_FAIL_V_MSG(ERR_FILE_CORRUPT, "Invalid tag in doc file: " + name3 + "."); } } else if (parser->get_node_type() == XMLParser::NODE_ELEMENT_END && parser->get_node_name() == "tutorials") break; //end of <tutorials> @@ -883,8 +881,7 @@ Error DocData::_load(Ref<XMLParser> parser) { prop2.description = parser->get_node_data(); c.properties.push_back(prop2); } else { - ERR_EXPLAIN("Invalid tag in doc file: " + name3); - ERR_FAIL_V(ERR_FILE_CORRUPT); + ERR_FAIL_V_MSG(ERR_FILE_CORRUPT, "Invalid tag in doc file: " + name3 + "."); } } else if (parser->get_node_type() == XMLParser::NODE_ELEMENT_END && parser->get_node_name() == "members") @@ -912,8 +909,7 @@ Error DocData::_load(Ref<XMLParser> parser) { prop2.description = parser->get_node_data(); c.theme_properties.push_back(prop2); } else { - ERR_EXPLAIN("Invalid tag in doc file: " + name3); - ERR_FAIL_V(ERR_FILE_CORRUPT); + ERR_FAIL_V_MSG(ERR_FILE_CORRUPT, "Invalid tag in doc file: " + name3 + "."); } } else if (parser->get_node_type() == XMLParser::NODE_ELEMENT_END && parser->get_node_name() == "theme_items") @@ -943,8 +939,7 @@ Error DocData::_load(Ref<XMLParser> parser) { constant2.description = parser->get_node_data(); c.constants.push_back(constant2); } else { - ERR_EXPLAIN("Invalid tag in doc file: " + name3); - ERR_FAIL_V(ERR_FILE_CORRUPT); + ERR_FAIL_V_MSG(ERR_FILE_CORRUPT, "Invalid tag in doc file: " + name3 + "."); } } else if (parser->get_node_type() == XMLParser::NODE_ELEMENT_END && parser->get_node_name() == "constants") @@ -953,8 +948,7 @@ Error DocData::_load(Ref<XMLParser> parser) { } else { - ERR_EXPLAIN("Invalid tag in doc file: " + name2); - ERR_FAIL_V(ERR_FILE_CORRUPT); + ERR_FAIL_V_MSG(ERR_FILE_CORRUPT, "Invalid tag in doc file: " + name2 + "."); } } else if (parser->get_node_type() == XMLParser::NODE_ELEMENT_END && parser->get_node_name() == "class") @@ -991,10 +985,8 @@ Error DocData::save_classes(const String &p_default_path, const Map<String, Stri Error err; String save_file = save_path.plus_file(c.name + ".xml"); FileAccessRef f = FileAccess::open(save_file, FileAccess::WRITE, &err); - if (err) { - ERR_EXPLAIN("Can't write doc file: " + save_file); - ERR_CONTINUE(err); - } + + ERR_CONTINUE_MSG(err != OK, "Can't write doc file: " + save_file + "."); _write_string(f, 0, "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"); |