handle exceptions during stream close

This commit is contained in:
Robin Appelman 2020-04-07 18:18:11 +02:00
commit b2a62743cf
2 changed files with 12 additions and 3 deletions

View file

@ -79,8 +79,13 @@ class NativeWriteStream extends NativeStream {
}
public function stream_close() {
$this->flushWrite();
return parent::stream_close();
try {
$this->flushWrite();
$flushResult = true;
} catch (\Exception $e) {
$flushResult = false;
}
return parent::stream_close() && $flushResult;
}
public function stream_tell() {