-
Notifications
You must be signed in to change notification settings - Fork 213
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
Add a way to handle unknown Intents #9
Comments
What do you want to do if you get an unknown intent? Currently, it will respond with the message in messages.NO_INTENT_FOUND, which by default is "Sorry, the application didn't know what to do with that intent". You can change this message to be anything you wish. |
It would depend on the application. For some I would just have it abort with no message. For others I might want to kick it over to a prompt for how to use the app. Most importantly though, I'd want to log the event, as it's a programmer error if this ever happens! |
As noted in the other issue, you can catch the exception using app.error, then log and re-prompt the user if you wish. Does that work for you? |
That's certainly possible. It's an event that SHOULDN'T really happen, so relegating it to being part of the error handler can make sense. |
From the docs, it doesn't seem like it's possible to capture an IntentRequest that doesn't match any of the registered Intents.
I think it'd be best to handle it using the same app.intent method, but with a null intent name:
The text was updated successfully, but these errors were encountered: