BotBuilder-Samples icon indicating copy to clipboard operation
BotBuilder-Samples copied to clipboard

[Java] AdapterWithErrorHandler is not capturing all the exceptions

Open fran893 opened this issue 3 years ago • 3 comments

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

fran893 avatar Apr 30 '21 20:04 fran893

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.

LeeParrishMSFT avatar May 05 '21 16:05 LeeParrishMSFT

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

Batta32 avatar May 05 '21 16:05 Batta32

@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 😊!

Batta32 avatar May 17 '21 18:05 Batta32

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

tracyboehrer avatar Mar 20 '24 15:03 tracyboehrer