microsoft / BotBuilder-Samples

Welcome to the Bot Framework samples repository. Here you will find task-focused samples in C#, JavaScript/TypeScript, and Python to help you get started with the Bot Framework SDK!
https://github.com/Microsoft/botframework
MIT License
4.37k stars 4.88k forks source link

[Java] AdapterWithErrorHandler is not capturing all the exceptions #3283

Closed fran893 closed 7 months ago

fran893 commented 3 years ago

Sample information

  1. Sample type: [samples]
  2. Sample language: [Java]
  3. Samples name:

Describe the bug

When a sample has an error, some of them are not captured by the AdapterWithErrorHandler, generating an HTTP 500 error and the error's activities are not displayed in the Emulator.

To Reproduce

Steps to reproduce the behavior:

  1. Execute the sample without configuring the application.properties
  2. Start a conversation in the Emulator
  3. When the "Choose language" prompt appears, select "Español"
  4. The error activities don't appear

Expected behavior

The expected behavior is that when an error occurs, the AdapterWithErrorHandler should capture it and the error activities should be displayed in the Emulator, like C#.

Screenshots

AdapterWithErrorHandler issue in Java samples image

Expected behavior in Java (like C#) image

LeeParrishMSFT commented 3 years ago

This is a unique issue to this sample, not with the base implementation of the AdapterWithErrorHandler. In this sample if the AdapterWithErrorHandler tries to send an Activity through the middleware it gets caught in the translation step again, which is the cause of the initial error, so nothing is output. To fix this this sample needs to send any error message Activities without using the middleware. Best course of action is to create a new AdapterWithErrorHandler just for this sample, and implement the setOnTurnError in a way that doesn't send through the middleware. This will not require changing the base AdapterWithErrorHandler that is part of the SDK.

Batta32 commented 3 years ago

Awesome @LeeParrishMSFT! Thanks for the information, we will review it as soon as we tackle the issue just for this sample 😊.

Batta32 commented 3 years ago

@LeeParrishMSFT we don't have permissions to transfer this issue back to botbuilder-samples but feel free to do it.

We will be updating the description of this issue in order to detail the samples that need to be updated 😊!

tracyboehrer commented 7 months ago

Java retired Nove 2023. The Java Samples are no longer maintained.