From a4bf64c58218a0439c174b99d2c4c0b8f79425da Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Sun, 2 Nov 2014 15:20:22 -0800 Subject: [PATCH] More useful stb-image error handling --- components/net/image/base.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/components/net/image/base.rs b/components/net/image/base.rs index 82215be9eb1d..affbd705ae0d 100644 --- a/components/net/image/base.rs +++ b/components/net/image/base.rs @@ -75,8 +75,14 @@ pub fn load_from_memory(buffer: &[u8]) -> Option { pixels: png::RGBA8(image.data) }) } - stb_image::ImageF32(_image) => fail!("HDR images not implemented"), - stb_image::Error(_) => None + stb_image::ImageF32(_image) => { + error!("HDR images not implemented"); + None + } + stb_image::Error(e) => { + error!("stb_image failed: {}", e); + None + } } } }