Skip to content
This repository was archived by the owner on Dec 4, 2023. It is now read-only.
This repository was archived by the owner on Dec 4, 2023. It is now read-only.

Dialog::run loses exception when innerRun completes exceptionally  #1428

@wifwucite

Description

@wifwucite

Github issues should be used for bugs and feature requests. Use Stack Overflow for general "how-to" questions.

Version

4.14.2

Describe the bug

Suppose an exception is thrown during a step of a waterfall dialog, then this exception should be reflected in the completable future returned by Dialog::run, but in fact Dialog::run returns a future that is completed normally.

To Reproduce

Take the flight booking example.
Replace the code in BookingDialog::destinationStep by
return Async.completeExceptionally(new RuntimeException(„Oops“))
In DialogBot::onMessageActivity add to the return statement
return Dialog.run(…).exceptionally(e -> { e.printStacktrace(); return null; });
Run the bot and send it some flight booking example like „book a flight to London“.

Expected behavior

I would expect the Oops exception stack trace to be printed, but in fact there is nothing.

Screenshots

None.

Additional context

The problem is located in the Dialog::run method. I suggest to change it like this
return dialogSet.createContext(turnContext) .thenCompose(dialogContext -> innerRun(turnContext, dialog.getId(), dialogContext, null)) .thenAccept(dummy -> {});
The crucial thing is to use thenCompose to call innerRun, otherwise its result is essentially ignored.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bot ServicesRequired for internal Azure reporting. Do not delete. Do not change color.bugIndicates an unexpected problem or an unintended behavior.customer-reportedIssue is created by anyone that is not a collaborator in the repository.needs-triageThe issue has just been created and it has not been reviewed by the team.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions