Fallback skill forward messages
parent
0a560602c7
commit
ef556557ad
|
@ -61,8 +61,8 @@ class FallbackSkill(MycroftSkill):
|
||||||
|
|
||||||
def handler(message):
|
def handler(message):
|
||||||
# indicate fallback handling start
|
# indicate fallback handling start
|
||||||
bus.emit(message.reply("mycroft.skill.handler.start",
|
bus.emit(message.forward("mycroft.skill.handler.start",
|
||||||
data={'handler': "fallback"}))
|
data={'handler': "fallback"}))
|
||||||
|
|
||||||
stopwatch = Stopwatch()
|
stopwatch = Stopwatch()
|
||||||
handler_name = None
|
handler_name = None
|
||||||
|
@ -73,7 +73,7 @@ class FallbackSkill(MycroftSkill):
|
||||||
if handler(message):
|
if handler(message):
|
||||||
# indicate completion
|
# indicate completion
|
||||||
handler_name = get_handler_name(handler)
|
handler_name = get_handler_name(handler)
|
||||||
bus.emit(message.reply(
|
bus.emit(message.forward(
|
||||||
'mycroft.skill.handler.complete',
|
'mycroft.skill.handler.complete',
|
||||||
data={'handler': "fallback",
|
data={'handler': "fallback",
|
||||||
"fallback_handler": handler_name}))
|
"fallback_handler": handler_name}))
|
||||||
|
@ -81,13 +81,13 @@ class FallbackSkill(MycroftSkill):
|
||||||
except Exception:
|
except Exception:
|
||||||
LOG.exception('Exception in fallback.')
|
LOG.exception('Exception in fallback.')
|
||||||
else: # No fallback could handle the utterance
|
else: # No fallback could handle the utterance
|
||||||
bus.emit(message.reply('complete_intent_failure'))
|
bus.emit(message.forward('complete_intent_failure'))
|
||||||
warning = "No fallback could handle intent."
|
warning = "No fallback could handle intent."
|
||||||
LOG.warning(warning)
|
LOG.warning(warning)
|
||||||
# indicate completion with exception
|
# indicate completion with exception
|
||||||
bus.emit(message.reply('mycroft.skill.handler.complete',
|
bus.emit(message.forward('mycroft.skill.handler.complete',
|
||||||
data={'handler': "fallback",
|
data={'handler': "fallback",
|
||||||
'exception': warning}))
|
'exception': warning}))
|
||||||
|
|
||||||
# Send timing metric
|
# Send timing metric
|
||||||
if message.context.get('ident'):
|
if message.context.get('ident'):
|
||||||
|
|
Loading…
Reference in New Issue