diff options
author | Marcel Admiraal <madmiraal@users.noreply.github.com> | 2019-11-11 10:24:04 +0100 |
---|---|---|
committer | Marcel Admiraal <madmiraal@users.noreply.github.com> | 2019-11-11 10:24:04 +0100 |
commit | d18b2e599d838201ecf14822d5823269859897da (patch) | |
tree | 67d7e58c17c9a7b387da6f32f44bd383e643359f /editor/plugins | |
parent | b7fdac60f16cef462a8ef97ce8c77308ba38a62f (diff) |
Remove all uses of ERR_EXPLAIN macros.
Diffstat (limited to 'editor/plugins')
-rw-r--r-- | editor/plugins/version_control_editor_plugin.cpp | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/editor/plugins/version_control_editor_plugin.cpp b/editor/plugins/version_control_editor_plugin.cpp index 66b16b82a0..783797ada4 100644 --- a/editor/plugins/version_control_editor_plugin.cpp +++ b/editor/plugins/version_control_editor_plugin.cpp @@ -106,29 +106,20 @@ void VersionControlEditorPlugin::_initialize_vcs() { register_editor(); - if (EditorVCSInterface::get_singleton()) { - - ERR_EXPLAIN(EditorVCSInterface::get_singleton()->get_vcs_name() + " is already active"); - return; - } + ERR_FAIL_COND_MSG(EditorVCSInterface::get_singleton(), EditorVCSInterface::get_singleton()->get_vcs_name() + " is already active"); const int id = set_up_choice->get_selected_id(); String selected_addon = set_up_choice->get_item_text(id); String path = ScriptServer::get_global_class_path(selected_addon); Ref<Script> script = ResourceLoader::load(path); - if (!script.is_valid()) { - ERR_EXPLAIN("VCS Addon path is invalid"); - } + ERR_FAIL_COND_MSG(!script.is_valid(), "VCS Addon path is invalid"); EditorVCSInterface *vcs_interface = memnew(EditorVCSInterface); ScriptInstance *addon_script_instance = script->instance_create(vcs_interface); - if (!addon_script_instance) { - ERR_FAIL_NULL(addon_script_instance); - return; - } + ERR_FAIL_COND_MSG(!addon_script_instance, "Failed to create addon script instance."); // The addon is attached as a script to the VCS interface as a proxy end-point vcs_interface->set_script_and_instance(script.get_ref_ptr(), addon_script_instance); @@ -137,10 +128,8 @@ void VersionControlEditorPlugin::_initialize_vcs() { EditorFileSystem::get_singleton()->connect("filesystem_changed", this, "_refresh_stage_area"); String res_dir = OS::get_singleton()->get_resource_dir(); - if (!EditorVCSInterface::get_singleton()->initialize(res_dir)) { - ERR_EXPLAIN("VCS was not initialized"); - } + ERR_FAIL_COND_MSG(!EditorVCSInterface::get_singleton()->initialize(res_dir), "VCS was not initialized"); _refresh_stage_area(); } |