curl/Handler: disallow OnData() to throw
This eliminates some complexity from class CurlRequest.
This commit is contained in:

committed by
Max Kellermann

parent
1e3089ffb7
commit
1f312b2e42
@@ -50,8 +50,12 @@ public:
|
||||
}
|
||||
|
||||
void OnData(ConstBuffer<void> data) override {
|
||||
if (fwrite(data.data, data.size, 1, stdout) != 1)
|
||||
throw std::runtime_error("Failed to write");
|
||||
try {
|
||||
if (fwrite(data.data, data.size, 1, stdout) != 1)
|
||||
throw std::runtime_error("Failed to write");
|
||||
} catch (...) {
|
||||
OnError(std::current_exception());
|
||||
}
|
||||
}
|
||||
|
||||
void OnEnd() override {
|
||||
|
Reference in New Issue
Block a user