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/webp | |
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/webp')
-rw-r--r-- | modules/webp/image_loader_webp.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/modules/webp/image_loader_webp.cpp b/modules/webp/image_loader_webp.cpp index 8986e49cf0..d1bfa20842 100644 --- a/modules/webp/image_loader_webp.cpp +++ b/modules/webp/image_loader_webp.cpp @@ -106,8 +106,7 @@ static Ref<Image> _webp_lossy_unpack(const PoolVector<uint8_t> &p_buffer) { errdec = WebPDecodeRGBInto(&r[4], size, dst_w.ptr(), datasize, 3 * features.width) == NULL; } - //ERR_EXPLAIN("Error decoding webp! - "+p_file); - ERR_FAIL_COND_V(errdec, Ref<Image>()); + ERR_FAIL_COND_V_MSG(errdec, Ref<Image>(), "Failed decoding WebP image."); dst_w.release(); @@ -121,7 +120,6 @@ Error webp_load_image_from_buffer(Image *p_image, const uint8_t *p_buffer, int p WebPBitstreamFeatures features; if (WebPGetFeatures(p_buffer, p_buffer_len, &features) != VP8_STATUS_OK) { - // ERR_EXPLAIN("Error decoding WEBP image"); ERR_FAIL_V(ERR_FILE_CORRUPT); } @@ -138,8 +136,7 @@ Error webp_load_image_from_buffer(Image *p_image, const uint8_t *p_buffer, int p } dst_w.release(); - //ERR_EXPLAIN("Error decoding webp!"); - ERR_FAIL_COND_V(errdec, ERR_FILE_CORRUPT); + ERR_FAIL_COND_V_MSG(errdec, ERR_FILE_CORRUPT, "Failed decoding WebP image."); p_image->create(features.width, features.height, 0, features.has_alpha ? Image::FORMAT_RGBA8 : Image::FORMAT_RGB8, dst_image); |