Skip to content

Commit b7c4718

Browse files
committed
remove some exceptions
1 parent 084731f commit b7c4718

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/odr/internal/zip/zip_util.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ class ReaderBuffer final : public std::streambuf {
1616
mz_zip_reader_extract_iter_state *iter, std::size_t buffer_size)
1717
: m_archive{std::move(archive)} {
1818
if (m_archive == nullptr) {
19-
throw std::invalid_argument("ReaderBuffer: archive is nullptr");
19+
throw NullPointerError("ReaderBuffer: archive is nullptr");
2020
}
2121
if (iter == nullptr) {
22-
throw std::invalid_argument("ReaderBuffer: iter is nullptr");
22+
throw NullPointerError("ReaderBuffer: iter is nullptr");
2323
}
2424
m_iter = iter;
2525
m_remaining = iter->file_stat.m_uncomp_size;
@@ -80,7 +80,7 @@ class FileInZipIstream final : public std::istream {
8080
explicit FileInZipIstream(std::unique_ptr<ReaderBuffer> sbuf)
8181
: std::istream(sbuf.get()), m_sbuf{std::move(sbuf)} {
8282
if (m_sbuf == nullptr) {
83-
throw std::invalid_argument("FileInZipIstream: sbuf is nullptr");
83+
throw NullPointerError("FileInZipIstream: sbuf is nullptr");
8484
}
8585
}
8686

@@ -93,7 +93,7 @@ class FileInZip final : public abstract::File {
9393
FileInZip(std::shared_ptr<const Archive> archive, std::uint32_t index)
9494
: m_archive{std::move(archive)}, m_index{index} {
9595
if (m_archive == nullptr) {
96-
throw std::invalid_argument("FileInZip: archive is nullptr");
96+
throw NullPointerError("FileInZip: archive is nullptr");
9797
}
9898
}
9999

@@ -182,7 +182,7 @@ Archive::Archive(const std::shared_ptr<common::DiskFile> &file)
182182
Archive::Archive(std::shared_ptr<abstract::File> file)
183183
: m_file{std::move(file)} {
184184
if (m_file == nullptr) {
185-
throw std::invalid_argument("Archive: file is nullptr");
185+
throw NullPointerError("Archive: file is nullptr");
186186
}
187187
m_stream = m_file->stream();
188188
open_from_file(m_zip, *m_file, *m_stream);

0 commit comments

Comments
 (0)