finos / spring-bot

Spring Boot + Java Integration for Symphony/Teams Chat Platform Bots and Apps
https://springbot.finos.org
Apache License 2.0
60 stars 35 forks source link

Error Reporting #2 #178

Closed robmoffat closed 3 years ago

robmoffat commented 3 years ago

At the moment, we produce the exception getMessage() on the screen, and display the stacktrace in the log.

It would be nice if users of the bot (i.e. developers) could also access the Stacktrace via Symphony.

  1. Create a class to contain the stacktrace and message as strings (ErrorDetails)
  2. Put this into the EntityJson of ErrorResponse.
  3. Add an StacktraceMessageConsumer that responds to the user typing "stacktrace" and outputting the stacktrace details on Symphony.
  4. When the user types stacktrace, the StacktraceMessageConsumer needs to call hist.getLastFromHistory(ErrorDetails.class, a) to get the ErrorDetails object
robmoffat commented 3 years ago

<pre>or <code> should allow you to display the trace nicely.

robmoffat commented 3 years ago

We should implement the exception handling in a different way, using @ExceptionHandler. See https://www.tutorialspoint.com/spring_boot/spring_boot_exception_handling.htm

Ideally, we create a MessageContext which keeps track in a thread-local of the room and the message details that are used. That way, we can create useful error messages.

If we had this, it would work for all bots, not just chat workflow.

Then, we can think about moving it out of chat workflow and into shared-streams.