diff options
Diffstat (limited to 'src/archive/plugins/ZzipArchivePlugin.cxx')
-rw-r--r-- | src/archive/plugins/ZzipArchivePlugin.cxx | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/archive/plugins/ZzipArchivePlugin.cxx b/src/archive/plugins/ZzipArchivePlugin.cxx index e83edb09b..45ae02cc3 100644 --- a/src/archive/plugins/ZzipArchivePlugin.cxx +++ b/src/archive/plugins/ZzipArchivePlugin.cxx @@ -29,6 +29,7 @@ #include "input/InputStream.hxx" #include "fs/Path.hxx" #include "util/RefCount.hxx" +#include "util/RuntimeError.hxx" #include "util/Error.hxx" #include "util/Domain.hxx" @@ -58,9 +59,8 @@ public: virtual void Visit(ArchiveVisitor &visitor) override; - virtual InputStream *OpenStream(const char *path, - Mutex &mutex, Cond &cond, - Error &error) override; + InputStream *OpenStream(const char *path, + Mutex &mutex, Cond &cond) override; }; static constexpr Domain zzip_domain("zzip"); @@ -129,15 +129,12 @@ struct ZzipInputStream final : public InputStream { InputStream * ZzipArchiveFile::OpenStream(const char *pathname, - Mutex &mutex, Cond &cond, - Error &error) + Mutex &mutex, Cond &cond) { ZZIP_FILE *_file = zzip_file_open(dir, pathname, 0); - if (_file == nullptr) { - error.Format(zzip_domain, "not found in the ZIP file: %s", - pathname); - return nullptr; - } + if (_file == nullptr) + throw FormatRuntimeError("not found in the ZIP file: %s", + pathname); return new ZzipInputStream(*this, pathname, mutex, cond, |