Skip to content

Conversation

@WyriHaximus
Copy link
Member

Follow up on @clue's comment here: #65 (comment)

@WyriHaximus
Copy link
Member Author

Ping @clue

$this->parseAndEmitRequest();
} catch (Exception $exception) {
$this->emit('error', [$exception]);
$this->emit('error', [$exception, $this]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a fan of this tbh. This should probably be discussed in the Stream component instead, but this messes with forwarding events.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would you suggest? Remove it here and from line 21, which would create a minor BC break. Or something else?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm undecided tbh.

This change in itself looks okay to me, but I assume we may wan to remove these in an upcoming stream release anyway. This would obviously create a (minor) BC break, so this is not something that's going to happen soon anyway.

Let's put it this way: Has this line caused any issue for you? Do you mind reverting this line (and tests accordingly) and possibly PR title?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tbh I have no problem reverting this line and associated tests. This line hasn't caused any issues. I'll revert it 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted

@clue clue modified the milestone: v0.4.2 Sep 13, 2016
@WyriHaximus
Copy link
Member Author

Not sure why this PR isn't seeing my latest changes. Contacting github

@WyriHaximus
Copy link
Member Author

Turned out I committed it to my fork instead of the original repo here 😊

Copy link
Member

@clue clue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR title should be updated to reflect what this now does, otherwise LGTM 👍

@WyriHaximus WyriHaximus changed the title Ensure consistent error events from RequestHeaderParser Remove all listeners after emitting error in RequestHeaderParser Nov 9, 2016
@WyriHaximus WyriHaximus merged commit 24a2af6 into master Nov 9, 2016
@clue clue deleted the fix-consistent-request-header-parser-error-events branch February 10, 2017 14:51
WyriHaximus added a commit to WyriHaximus/http that referenced this pull request May 31, 2017
…ctphp#68)

* Ensure removeAllListeners on all error event in RequestHeaderParser

* Ensure all error events from RequestHeaderParser emit $this as second item in event

* Reverted emitting $this with error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants