Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding exception handling for better user experience #810

Closed
tinodj opened this issue Jul 29, 2020 · 3 comments · Fixed by #814
Closed

Adding exception handling for better user experience #810

tinodj opened this issue Jul 29, 2020 · 3 comments · Fixed by #814
Assignees
Labels
Milestone

Comments

@tinodj
Copy link

tinodj commented Jul 29, 2020

This line

call_user_func($this->callbacks[$consumer_tag], $message);

might get replaced with

            if (is_callable($this->callbacks[$consumer_tag])) {
                call_user_func($this->callbacks[$consumer_tag], $message);
            }else{
                throw new AMQPInvalidArgumentException(sprintf('%s is not callable.',var_export($this->callbacks[$consumer_tag], true)));
            }

for better user experience.

@lukebakken
Copy link
Collaborator

Would you mind checking if there are other places this could apply and open a pull request with a test to address them? Thank you.

@lukebakken lukebakken added this to the 2.12.0 milestone Jul 29, 2020
@lukebakken lukebakken self-assigned this Jul 29, 2020
@ramunasd
Copy link
Member

@tinodj callback check in this place would hurt performance, it's better to check it before assignment, in method basic_consume()

@tinodj
Copy link
Author

tinodj commented Jul 29, 2020

@tinodj callback check in this place would hurt performance, it's better to check it before assignment, in method basic_consume()

I agree - you are right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants