Exceptions in Jovo


Hello everyone!

Is there a way for Jovo to capture exceptions?

That is, if for example an error occurs during an interaction, is there a “try & catch” that makes a voice message such as “Sorry, this feature is not available at the moment”?

Thank you very much in advance!


There might be a better solution built right into JOVO but you can try using .toIntent('YourUnhandledIntent') if you catch an error.

try {
        // Something
    catch (error) {
        return this.toIntent('YourErrorMessageIntent')

You can then define a YourErrorMessageIntent handler which will return your error message text.


Thank you so much for answering @Marko_Arezina




A “global catch” can be handled in ON_ERROR()

        let error = this.$handleRequest.error;
        this.tell('Something went wrong');


Hi @AlexSwe,

I added that code under the last Intent in app.setHandler but when an error occurs I don’t get the defined error. The error appears as before.

I don’t know if I’m doing something wrong.



Can someone help me, please?


So you jump into ON_ERROR but this.$handleRequest.error is empty?


This does not go to ON_ERROR:

     throw "test";
      console.log("got error");

This is what gets logged:


TypeError: Cannot read property ‘indexOf’ of undefined
at Function.printError (G:\0DEVELOPMENT\TFS\Test\Blurt\jovo\retirement\node_modules.pnpm\[email protected]\node_modules\jovo-core\src\errors\JovoError.ts:29:19)
at App.handle (G:\0DEVELOPMENT\TFS\Test\Blurt\jovo\retirement\node_modules.pnpm\[email protected]\node_modules\jovo-core\src\core\BaseApp.ts:293:17)
at processTicksAndRejections (internal/process/task_queues.js:97:5)


Hey @vguruv

basic expressions are not supported. ON_ERROR listens to objects type of Error. This should work:

    throw new Error("test");
     console.log("got error");