Skip to content

Commit 1c25971

Browse files
committed
ZIP: replace unused std::runtime_error("...") with an error print
We could have thrown an exception here, but it is better for library code to be resilient and print a warning instead so that users can rectify things without crashing their app. Closes: #112
1 parent 20491bd commit 1c25971

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/lib/io/ZIP.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,10 @@ class ZipStreambufCompress:public std::streambuf
399399
{if(pptr() && pptr()>pbase()) return process(false);return 0;}
400400

401401
virtual int underflow()
402-
{std::runtime_error("Attempt to read write only ostream");return 0;}
402+
{
403+
std::cerr << "error: Partio::ZipStreambufCompress attempted to read a write-only ostream" << std::endl;
404+
return 0;
405+
}
403406

404407
virtual int overflow(int c=EOF)
405408
{if(c!=EOF){*pptr()=static_cast<char>(c);pbump(1);}

0 commit comments

Comments
 (0)