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

Room&Contact.find() should throw exception when it get more than one value #229

Closed
lijiarui opened this issue Feb 3, 2017 · 5 comments
Closed
Assignees

Comments

@lijiarui
Copy link
Member

lijiarui commented Feb 3, 2017

When I have two contacts with the same name, using function find() will return one of the contacts randomly, which is not easy to debug.

We should throw an exception when function find() return more than one value.

@huan
Copy link
Member

huan commented Feb 4, 2017

Agree. PR is welcome.

@huan
Copy link
Member

huan commented Feb 8, 2017

Instead of throw, I'm now considering to use a log.warn() instead.

Because sometimes be able to just using the first find result will be very convienence.

@lijiarui
Copy link
Member Author

lijiarui commented Feb 8, 2017

It's a good idea, I will change then.

@huan
Copy link
Member

huan commented Feb 8, 2017

We can set the level to warn or info. which one do you think is better?

@lijiarui
Copy link
Member Author

lijiarui commented Feb 8, 2017

I think warn is better, because it can cause more attention.

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

No branches or pull requests

2 participants