When the user says "read john 3:100", I have a ReadBibleVerse action that matches book:john
, chapter:3
, verse:100
. The endpoint will return a 404, since there is no verse 100.
I want that action to capture the error and replan
to a "read chapter" request, passing along book:john
and chapter:3
.
What I have...
action (ReadBibleVerse) {
collect {
input (book) {…}
input (chapter) { type (ChapterNum) … }
input (verse) {…}
}
output (Scripture) {
throws {
unknown-error {
on-catch {
replan {
dialog ("Unknown verse, trying the chapter.")
intent {
goal: Scripture
route: ReadBibleChapter
}}}}}}}
…what I get is "Unknown verse, trying the chapter. I need a book to continue."
I'm clearly hitting the error and, I believe, being "replanned" to ReadBibleChapter, but I'm also getting "I need a book to continue." because I need to explicitly pass along book
and chapter
?
I found intent.value, which appears to solve my problem, except I can't seem to find the correct format:
value: ChapterNum
value: ChapterNum (chapter)
value: [namespace].ChapterNum { $expr(chapter) }
- more various nonsense
- …