From c5170290f8e222baeadaa4cec6279e3b5a9b1520 Mon Sep 17 00:00:00 2001 From: artemp Date: Tue, 16 Apr 2013 17:30:17 +0100 Subject: [PATCH] + image_reader : consistent error handling - throw image_reader_exception rather than returning 0 pointer. --- src/image_reader.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/image_reader.cpp b/src/image_reader.cpp index 1ae83b42a..afa572b5d 100644 --- a/src/image_reader.cpp +++ b/src/image_reader.cpp @@ -68,7 +68,8 @@ image_reader* get_image_reader(char const* data, size_t size) boost::optional type = type_from_bytes(data,size); if (type) return factory::instance().create_object(*type, data,size); - return 0; + else + throw image_reader_exception("image_reader: can't determine type from input data"); } image_reader* get_image_reader(std::string const& filename,std::string const& type)