diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2019-08-17 13:04:33 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2019-08-17 13:31:22 +0200 |
commit | d3153c28f0b82ca047a892f6dbcd9d5f9344e3d5 (patch) | |
tree | dc06516ab438b65a025d5e5c0bab9cc97735e2ee /modules/hdr | |
parent | de4aabe89b7b68677f145f21c956183bbc92f686 (diff) |
Replace last occurrences of 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG'
The last remaining ERR_EXPLAIN call is in FreeType code and makes sense as is
(conditionally defines the error message).
There are a few ERR_EXPLAINC calls for C-strings where String is not included
which can stay as is to avoid adding additional _MSGC macros just for that.
Part of #31244.
Diffstat (limited to 'modules/hdr')
-rw-r--r-- | modules/hdr/image_loader_hdr.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/modules/hdr/image_loader_hdr.cpp b/modules/hdr/image_loader_hdr.cpp index e610619b54..1abf26bfee 100644 --- a/modules/hdr/image_loader_hdr.cpp +++ b/modules/hdr/image_loader_hdr.cpp @@ -37,7 +37,7 @@ Error ImageLoaderHDR::load_image(Ref<Image> p_image, FileAccess *f, bool p_force String header = f->get_token(); - ERR_FAIL_COND_V(header != "#?RADIANCE" && header != "#?RGBE", ERR_FILE_UNRECOGNIZED); + ERR_FAIL_COND_V_MSG(header != "#?RADIANCE" && header != "#?RGBE", ERR_FILE_UNRECOGNIZED, "Unsupported header information in HDR: " + header + "."); while (true) { String line = f->get_line(); @@ -45,12 +45,9 @@ Error ImageLoaderHDR::load_image(Ref<Image> p_image, FileAccess *f, bool p_force if (line == "") // empty line indicates end of header break; if (line.begins_with("FORMAT=")) { // leave option to implement other commands - if (line != "FORMAT=32-bit_rle_rgbe") { - ERR_EXPLAIN("Only 32-bit_rle_rgbe is supported for HDR files."); - return ERR_FILE_UNRECOGNIZED; - } + ERR_FAIL_COND_V_MSG(line != "FORMAT=32-bit_rle_rgbe", ERR_FILE_UNRECOGNIZED, "Only 32-bit_rle_rgbe is supported for HDR files."); } else if (!line.begins_with("#")) { // not comment - WARN_PRINTS("Ignoring unsupported header information in HDR : " + line); + WARN_PRINTS("Ignoring unsupported header information in HDR: " + line + "."); } } |