-
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check writable flag rather than for null resource
Also null resource when writing in watcher callback fails. Fixes #20.
- Loading branch information
Showing
1 changed file
with
2 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fdcf400
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Umm, I actually suggested directly throwing an Error in #20, in case the stream was ended by ourselves.
fdcf400
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's possible, but as far as I'm aware none of the other streams differentiate between the user closing and closing due to an error - both cases result in a
StreamException
when writing. If doing so wouldn't be considered a BC break (it shouldn't be IMO), then maybe we can do so.fdcf400
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Converting a condition which must not happen to an \Error is always a bugfix.
fdcf400
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not a BC break, because a
ClosedException
is aStreamException
, but directly throwing is a BC break.