Skip to main content

Any recommendations for error handling with custom server workflow activities

Comments

3 comments

  • Ken Lyon

    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
  • Berend Veldkamp

    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
  • Ken Lyon

    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

Please sign in to leave a comment.