diff options
author | Robin Hübner <profan@prfn.se> | 2019-08-09 06:49:33 +0200 |
---|---|---|
committer | Robin Hübner <profan@prfn.se> | 2019-08-09 11:13:24 +0200 |
commit | 6ab118c4646b136cd83ff8406ce62a2576809def (patch) | |
tree | 7dc10741d9b7c609951f3568e31479257311c59b /platform/osx | |
parent | 22b42c3315081144ecea26e4a51600255dc8eed6 (diff) | |
download | redot-engine-6ab118c4646b136cd83ff8406ce62a2576809def.tar.gz |
Replace 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG' in "platform", "modules/gdnative", "modules/gdscript" directories.
Diffstat (limited to 'platform/osx')
-rw-r--r-- | platform/osx/os_osx.mm | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index a48f784529..ab77897b08 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -1719,10 +1719,7 @@ Error OS_OSX::open_dynamic_library(const String p_path, void *&p_library_handle, } p_library_handle = dlopen(path.utf8().get_data(), RTLD_NOW); - if (!p_library_handle) { - ERR_EXPLAIN("Can't open dynamic library: " + p_path + ". Error: " + dlerror()); - ERR_FAIL_V(ERR_CANT_OPEN); - } + ERR_FAIL_COND_V_MSG(!p_library_handle, ERR_CANT_OPEN, "Can't open dynamic library: " + p_path + ", error: " + dlerror() + "."); return OK; } @@ -1962,15 +1959,10 @@ void OS_OSX::set_native_icon(const String &p_filename) { memdelete(f); NSData *icon_data = [[[NSData alloc] initWithBytes:&data.write[0] length:len] autorelease]; - if (!icon_data) { - ERR_EXPLAIN("Error reading icon data"); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!icon_data, "Error reading icon data."); + NSImage *icon = [[[NSImage alloc] initWithData:icon_data] autorelease]; - if (!icon) { - ERR_EXPLAIN("Error loading icon"); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!icon, "Error loading icon."); [NSApp setApplicationIconImage:icon]; } |