From 5ca74604217758d91e344b052fe87c9eda8940a9 Mon Sep 17 00:00:00 2001 From: Michael Alexsander Silva Dias Date: Thu, 8 Aug 2019 17:08:27 -0300 Subject: [PATCH] Replace 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG' in "main" and "servers" directories --- main/main.cpp | 47 +++++++-------------- main/tests/test_gdscript.cpp | 14 ++---- main/tests/test_math.cpp | 6 +-- servers/audio/voice_rb_sw.h | 3 +- servers/physics/collision_object_sw.h | 6 +-- servers/physics/physics_server_sw.cpp | 26 +++--------- servers/physics_2d/physics_2d_server_sw.cpp | 28 +++--------- servers/visual/visual_server_canvas.cpp | 10 +---- servers/visual_server.cpp | 11 +---- 9 files changed, 37 insertions(+), 114 deletions(-) diff --git a/main/main.cpp b/main/main.cpp index 39cd2548fb..027273c4f4 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -816,10 +816,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph String bp = breakpoints[i]; int sp = bp.find_last(":"); - if (sp == -1) { - ERR_EXPLAIN("Invalid breakpoint: '" + bp + "', expected file:line format."); - ERR_CONTINUE(true); - } + ERR_CONTINUE_MSG(sp == -1, "Invalid breakpoint: '" + bp + "', expected file:line format."); script_debugger->insert_breakpoint(bp.substr(sp + 1, bp.length()).to_int(), bp.substr(0, sp)); } @@ -1375,10 +1372,7 @@ bool Main::start() { { DirAccessRef da = DirAccess::open(doc_tool); - if (!da) { - ERR_EXPLAIN("Argument supplied to --doctool must be a base Godot build directory"); - ERR_FAIL_V(false); - } + ERR_FAIL_COND_V_MSG(!da, false, "Argument supplied to --doctool must be a base Godot build directory."); } DocData doc; doc.generate(doc_base); @@ -1462,8 +1456,7 @@ bool Main::start() { } else if (script != "") { Ref