-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Modify Function Room.create
return type, from Promise<Room>
to Promise<Room|null>
#616
Comments
Could you explain the pros and cons between the two design? A good purpose should go with good reasons. |
After I thought more, maybe it return If it cannot create a room, we want to get the fail status and don't see more error. Like And Like |
Yes, that's the right answer after you think more. Please think more before post question/suggestions in the future, at least explain your ideas with pros and cons in detail. |
But now it returns and throw error, maybe is should return <Room | null> instead of throw error. |
I agree your purpose. Please change the title of this issue to better reflect your purpose, and I'll label it as a enhancement |
Room.create
return type, from Promise<Room>
to Promise<boolean>
Room.create
return type, from Promise<Room>
to Promise<Room|null>
In CASE 1 we should return null, in CASE 2 we should throw an exception. So my question is: when will |
Close this issue due to inactivity for almost two weeks. |
We should not return We are planning to throw an Exception instead. See also: #683 (comment) |
Now, function
Room.create()
return type as follows:I suggest it return
Promise<boolean>
to detect whether it can create room successfullyRelated logs as follows:
If it can create room successfully, return as follows:
If it cannot create room successfully, throw the following exception:
The text was updated successfully, but these errors were encountered: