Any recommendations for error handling with custom server workflow activities
I have a custom server workflow activity, that may throw a (.NET) exception. What is the best way to handle this?
Currently I have a Try-Catch in the client workflow that wraps around the Run Workflow (server WF) activity. But the error message is just Server workflow failed.
How can I get more detailed information from the original exception?
-
Hi Berend,
If you use a Try-Catch in the server workflow, you will probably see the details you want. You could then use the Throw activity to fail the server workflow with a more appropriate message, or perhaps pass back an error message in the server workflow's outputs.
0 -
Yes, I added a Try-Catch to the server workflow, and I can see that =$tryCatch1.error.message contains a string like:
[WF: Activity execution error] Failed to execute activity 65 with action mycustomaction: <my-own-exception-message-here>Still inside the Catch, I then throw a new exception with this message, but the $tryCatch1.error.message variable in the client workflow still only has:
[WF: activity error] Server workflow failed.I could probably return the error object in a server workflow's output, but that would kind of defeat the whole purpose of exception handling.
0 -
I think that might be your best bet. In some ways it's not entirely uncommon. Many Esri REST APIs will return a 200 response but with an error property set.
I think we didn't really design workflows to throw exceptions to other workflows.
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
3 Kommentare