-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Refactor platform_services sample #8949
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
Conversation
mit-mit
left a comment
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.
Thanks, looks great. But looks like you missed the throw part?
| response.error("UNAVAILABLE", "Battery level not available.", null); | ||
| } | ||
| } else { | ||
| throw new IllegalArgumentException("Unknown method " + call.method); |
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.
I think you missed the throw part?
| response.error("UNAVAILABLE", "Battery level not available.", null); | ||
| } | ||
| } else { | ||
| throw new IllegalArgumentException("Unknown method " + call.method); |
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.
I think we should handle unknown methods by response.error too. That's what we'll have to do on the iOS side, because of the difficulty of manual memory management in face of exceptions.
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.
As discussed, removed the exception for now.
No description provided.