Improve zlib error messages.

GitOrigin-RevId: 0a630e21e3dd142cefdcc16dc4478f108d0e3a66
This commit is contained in:
levlam 2018-10-24 22:56:48 +03:00
parent 923cf40de6
commit da06b62499

View File

@ -37,7 +37,7 @@ Status Gzip::init_encode() {
mode_ = Encode;
int ret = deflateInit2(&impl_->stream_, 6, Z_DEFLATED, 15, MAX_MEM_LEVEL, Z_DEFAULT_STRATEGY);
if (ret != Z_OK) {
return Status::Error("zlib deflate init failed");
return Status::Error(PSLICE() << "zlib deflate init failed: " << ret);
}
return Status::OK();
}
@ -48,7 +48,7 @@ Status Gzip::init_decode() {
mode_ = Decode;
int ret = inflateInit2(&impl_->stream_, MAX_WBITS + 32);
if (ret != Z_OK) {
return Status::Error("zlib inflate init failed");
return Status::Error(PSLICE() << "zlib inflate init failed: " << ret);
}
return Status::OK();
}