1
0
mirror of https://github.com/danog/byte-stream.git synced 2024-11-26 20:04:51 +01:00

Throw correct exception in ResourceOutputStream after close

Fixes #35.
This commit is contained in:
Niklas Keller 2018-02-07 13:49:07 +01:00
parent 1b0b8daed4
commit 2cb8005742

View File

@ -146,7 +146,7 @@ final class ResourceOutputStream implements OutputStream {
private function send(string $data, bool $end = false): Promise {
if (!$this->writable) {
return new Failure(new StreamException("The stream is not writable"));
return new Failure(new ClosedException("The stream is not writable"));
}
$length = \strlen($data);