summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/io/zlib_error.h6
1 files changed, 4 insertions, 2 deletions
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 <stdexcept>
+#include <zlib.h>
///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)
{}
};