From 4f96ef6b0d4aede214d208090e86cb7b8091f49c Mon Sep 17 00:00:00 2001 From: ljfa-ag Date: Tue, 15 Sep 2015 10:58:49 +0200 Subject: Change zlib_error to take message and code --- include/io/zlib_error.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/io/zlib_error.h b/include/io/zlib_error.h index 12eaf20a3f..ce375a6ccd 100644 --- a/include/io/zlib_error.h +++ b/include/io/zlib_error.h @@ -2,6 +2,7 @@ #define ZLIB_ERROR_H_INCLUDED #include +#include ///Exception thrown in case zlib encounters a problem class zlib_error : public std::runtime_error @@ -9,8 +10,9 @@ class zlib_error : public std::runtime_error public: const int errcode; - explicit zlib_error(const char* what_arg, int errcode = -1): - std::runtime_error(what_arg), errcode(errcode) + explicit zlib_error(const char* msg, int errcode): + std::runtime_error(std::string(zError(errcode)) + ": " + msg), + errcode(errcode) {} }; -- cgit 0.0.5-2-1-g0f52