Bixby Developer Center

References

throws

optional

Lists all errors that can be thrown by function implementations when executing this action.

Examples

  output (HabitatPod) {
throws {
error (MultipleMatches) {
property (matches) {
type (HabitatPod)
min (Required)
max (Many)
}
on-catch {
replan {
intent {
goal { HabitatPod @prompt-behavior(AlwaysSelection) }
value { $expr(matches) }
}
}
}
}
}
}

View f766695 on GitHub

action (GetResultReplan) {
type (Search)
description (This demonstrates how to replan on an error.)
output (Result) {
throws {
error (ErrorWhichCausesReplan) {
// When this error is caught, it will attempt to fulfill the goal for this action by
// running the intent given in `replan` below.
on-catch {
replan {
dialog("An error was caught, and now, we will replan to another way to get a Result.")
intent {
goal: Result
route: GetResult
}
}
}
}
}
}
}

View master on GitHub

action (FindShoeError) {
type (Search)
description (Show how to deal with HTTP errors.)
output (Shoe) {
throws {
error (ErrorWhichHalts) {
on-catch {
halt {
dialog("HTTP error was caught, and execution halted.")
}
}
}
}
}
}

View master on GitHub

For a complete example using throws, see the Input Validation and Error Handling sample capsule.

Child Keys

error
optional
Defines named, modeled errors with the required on-catch clause
unknown-error
optional
Defines an unknown error with a required on-catch clause