Skip to content
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

Numeric error codes are not handled correctly #788

Open
gcampax opened this issue Sep 16, 2021 · 0 comments
Open

Numeric error codes are not handled correctly #788

gcampax opened this issue Sep 16, 2021 · 0 comments
Labels
bug Something isn't working dialogue-agent Issues with the dialogue agent at runtime (not state machine related) P2 We need to fix it (backlog)

Comments

@gcampax
Copy link
Contributor

gcampax commented Sep 16, 2021

The HTTP helpers in Thingpedia will throw errors with a numeric code property. If those bubble up, Genie will barf:

Failed to invoke action HTTPError: Unexpected HTTP error 502 in request to https://streams.kqed.org/kqedradio
    at IncomingMessage.<anonymous> (/var/home/gcampagn/Projects/almond-server/node_modules/thingpedia/dist/helpers/http.js:139:35)
    at IncomingMessage.emit (events.js:387:35)
    at endReadableNT (internal/streams/readable.js:1317:12)
    at processTicksAndRejections (internal/process/task_queues.js:82:21) {
  code: 502,
  url: 'https://streams.kqed.org/kqedradio',
  detail: ''
}
Genie says: Sorry, I had an error processing your command: The expression evaluated to a falsy value: assert_1.default(typeof value ==='string').
AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value:

  assert_1.default(typeof value === 'string')

    at new EnumValue (/var/home/gcampagn/Projects/almond-server/node_modules/thingtalk/dist/ast/values.js:1339:25)
    at InferenceStatementExecutor.executeStatement (/var/home/gcampagn/Projects/almond-server/node_modules/genie-toolkit/dist/lib/dialogue-agent/statement_executor.js:131:30)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async ExecutionDialogueAgent.execute (/var/home/gcampagn/Projects/almond-server/node_modules/genie-toolkit/dist/lib/dialogue-agent/abstract_dialogue_agent.js:124:93)
    at async ThingTalkDialogueHandler._executeCurrentState (/var/home/gcampagn/Projects/almond-server/node_modules/genie-toolkit/dist/lib/dialogue-agent/handlers/thingtalk.js:369:81)
    at async DialogueLoop._handleUserInput (/var/home/gcampagn/Projects/almond-server/node_modules/genie-toolkit/dist/lib/dialogue-agent/dialogue-loop.js:242:27)
    at async DialogueLoop._loop (/var/home/gcampagn/Projects/almond-server/node_modules/genie-toolkit/dist/lib/dialogue-agent/dialogue-loop.js:288:21) {
  generatedMessage: true,
  code: 'ERR_ASSERTION',
  actual: false,
  expected: true,
  operator: '=='
}

Instead, it should recognize those errors and treat them as unexpected errors.

@gcampax gcampax added bug Something isn't working dialogue-agent Issues with the dialogue agent at runtime (not state machine related) P2 We need to fix it (backlog) labels Sep 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dialogue-agent Issues with the dialogue agent at runtime (not state machine related) P2 We need to fix it (backlog)
Projects
None yet
Development

No branches or pull requests

1 participant