Bixby Developer Center

Guides
References

halt

optional

Effect that halts execution after a dialog message event. You can use halt within an on-empty, on-catch, or ordered-effects block.

Examples

action (GetResultHalt) {
type (Search)
description (This will never succeed, and will always halt.)
collect {

}
output (Result) {
throws {
error (ErrorWhichHalts) {
on-catch {
halt {
dialog {
template ("Execution is halted because of the ErrorWhichHalts error.")
}
}
}
}
}
}
}

View on GitHub

In the example below, a capsule checks to see if there is no data available and throws a NoData checked error.

 //if response is bad, throw NoData error
if(!response || response.failure || !(response.globalairquality)) throw fail.checkedError("no air quality data", "NoData");

The output of the GetAirQuality action in that capsule catches this error and uses a noDataAirQuality template-macro to provide a useful error using on-catch and halt:

action (GetAirQuality) {
description (Get the air quality for a location)
type (Search)

...

output (AirQuality) {
throws {
error (NoData) {
on-catch {
halt {
dialog {
template-macro(noDataAirQuality)
}
}
}
}
}
}
}

The actual definition of the template macro (template-macro-def) looks like this:

template-macro-def(noDataAirQuality){
content: template ("No air quality data available.")
}

Child Keys

dialog
optional
An output dialog template that should be rendered when execution halts
display
optional
An expression that will resolve to a result that should be rendered when execution halts