aboutsummaryrefslogtreecommitdiffstats
path: root/common/rdr/ZlibOutStream.cxx
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2024-09-02 22:58:35 +0200
committerPierre Ossman <ossman@cendio.se>2024-11-06 21:06:27 +0100
commit1d9b2f9984fefbc050c8e3295397ffd280e41788 (patch)
treec6fa8a4f5e0e6fbc0e165c2bd80b2c81a48bf6bc /common/rdr/ZlibOutStream.cxx
parent5c3588c464520a4757bfc20974090e21af220cdc (diff)
downloadtigervnc-1d9b2f9984fefbc050c8e3295397ffd280e41788.tar.gz
tigervnc-1d9b2f9984fefbc050c8e3295397ffd280e41788.zip
Use standard exception classes
Use the more specific already included exception classes for common errors to keep things more understandable.
Diffstat (limited to 'common/rdr/ZlibOutStream.cxx')
-rw-r--r--common/rdr/ZlibOutStream.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/common/rdr/ZlibOutStream.cxx b/common/rdr/ZlibOutStream.cxx
index 1b59f54e..13788f8d 100644
--- a/common/rdr/ZlibOutStream.cxx
+++ b/common/rdr/ZlibOutStream.cxx
@@ -24,7 +24,6 @@
#include <stdio.h>
#include <rdr/ZlibOutStream.h>
-#include <rdr/Exception.h>
#include <rfb/LogWriter.h>
#include <zlib.h>
@@ -46,7 +45,7 @@ ZlibOutStream::ZlibOutStream(OutStream* os, int compressLevel)
zs->avail_in = 0;
if (deflateInit(zs, compressLevel) != Z_OK) {
delete zs;
- throw Exception("ZlibOutStream: deflateInit failed");
+ throw std::runtime_error("ZlibOutStream: deflateInit failed");
}
}
@@ -113,7 +112,7 @@ void ZlibOutStream::deflate(int flush)
int rc;
if (!underlying)
- throw Exception("ZlibOutStream: underlying OutStream has not been set");
+ throw std::runtime_error("ZlibOutStream: underlying OutStream has not been set");
if ((flush == Z_NO_FLUSH) && (zs->avail_in == 0))
return;
@@ -134,7 +133,7 @@ void ZlibOutStream::deflate(int flush)
if ((rc == Z_BUF_ERROR) && (flush != Z_NO_FLUSH))
break;
- throw Exception("ZlibOutStream: deflate failed");
+ throw std::runtime_error("ZlibOutStream: deflate failed");
}
#ifdef ZLIBOUT_DEBUG
@@ -168,7 +167,7 @@ void ZlibOutStream::checkCompressionLevel()
// explicit flush we did above. It should be safe to ignore though
// as the first flush should have left things in a stable state...
if (rc != Z_BUF_ERROR)
- throw Exception("ZlibOutStream: deflateParams failed");
+ throw std::runtime_error("ZlibOutStream: deflateParams failed");
}
compressionLevel = newLevel;