How to catch exceptions thrown by Elsa 3.2.0 ? #290
Unanswered
anupam-mangal
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am using Elsa 3.2.0 for my Blazor WASM project that displays Elsa workflows using the ThemedComponentWrapper as below:
@page "/workflow-definitions"
@using Elsa.Studio.Workflows.Components.WorkflowDefinitionList
@code {
[Inject] NavigationManager NavigationManager { get; set; } = default!;
}
In ideal conditions this page loads perfectly fine with Elsa Workflows as created by the user. However, in case the server is not running, it keeps retrying for a while and finally throws an HttpRequestException (which is expected). The problem is that I could not find any way to catch this exception and handle it for my application to show a user friendly message instead of the yellow bar showing 'Unhandled Error' at the bottom of the screen.
I did not find anything about exceptions in the Elsa documentation. Also in the Elsa Studio code, I see that the calls to fetch the Workflow definitions or instance lists are not enclosed in a try catch block (i.e. exception handling is not present).
Any help on how to get hold of the HttpRequestException in the above page code would be appreciated. The full stack trace of the exception is as below:
Beta Was this translation helpful? Give feedback.
All reactions