Exception not caught in custom mobile app
Using the mobile SDK, I have written a custom mobile app for Windows.
When I try to run a server workflow, I can't seem to catch any exceptions that may occur. For instance, if the workflow server cannot be found, an HttpRequestException is raised, and the application shows a messagebox with the stacktrace. But in this particular case, I want to catch all exceptions, and silently continue. How can I do that?
My code is basically this:
if (!await _networkOperations.HasConnection.ExecuteAsync())
{
return; // no network at all, don't bother trying
}
try
{
var workflowArgs = new WorkflowArgs { Url = "https://myserver/portal/home/item.html?id=9196d1ff94bd4c0eb5f61a6fc84f9aaa" };
// Exception may be raised on the following line:
var result = await _workflowOperations.Run.ExecuteAsync(workflowArgs);
}
catch (Exception)
{
// I never get here
}
It doesn't matter if I call Run.Execute() or await Run.ExecuteAsync(), in both cases the catch block is never reached.
This is what the application shows:
(roughly translates to: "Error executing workflow, the text that belongs to this error code cannot be found. The name or address of the server cannot be resolved")
Du måste logga in om du vill lämna en kommentar.
Kommentarer
0 kommentarer