From cd99157e2e524b6546f574cac19c49b554057dfb Mon Sep 17 00:00:00 2001 From: "Andrii Doroshenko (Xrayez)" Date: Sat, 31 Aug 2019 20:47:36 +0300 Subject: Provide error messages when PNG save fails --- drivers/png/resource_saver_png.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/png') diff --git a/drivers/png/resource_saver_png.cpp b/drivers/png/resource_saver_png.cpp index 7a2eeafdc3..3b3f1506dc 100644 --- a/drivers/png/resource_saver_png.cpp +++ b/drivers/png/resource_saver_png.cpp @@ -53,9 +53,9 @@ Error ResourceSaverPNG::save_image(const String &p_path, const Ref &p_img PoolVector buffer; Error err = PNGDriverCommon::image_to_png(p_img, buffer); - ERR_FAIL_COND_V(err, err); + ERR_FAIL_COND_V_MSG(err, err, "Can't convert image to PNG."); FileAccess *file = FileAccess::open(p_path, FileAccess::WRITE, &err); - ERR_FAIL_COND_V(err, err); + ERR_FAIL_COND_V_MSG(err, err, vformat("Can't save PNG at path: '%s'.", p_path)); PoolVector::Read reader = buffer.read(); -- cgit v1.2.3