Hoppa till huvudinnehållet

Try Catch with Nested Display Form Not Catching

Kommentarer

4 kommentarer

  • Ken Lyon

    Hi @Kevin Rathgeber? ,

     

    Thanks for mentioning this. It looks like a bug to me. I tried replacing the Display Form with a Container to give this structure:

     

    • try
      • container
        • web request
    • catch
      • alert

     

    In this case, the error from the web request caused the alert to be shown.

     

    I think that we had intended Display Form to do the same, as the code looks like it's attempting to switch to the catch path.

     

    I've logged a bug to follow up on this. For future communication on this, please refer to bug #47798.

    0
  • Ken Lyon

    Hi @Kevin Rathgeber? ,

     

    I've been looking into this issue today. I realized that this behaviour is by design. When an error occurs in a form event, the current error handling allows the rest of the form to load and continue to operate.

     

    In order to achieve the behaviour you expected, the form would need to be closed. This would be too much of a breaking change to introduce into the product.

     

    I'm interested to learn more about your use case. Would you prefer for the form to close? If enough people wanted such a feature, we could consider introducing a new input to the Display Form activity that causes it to fail when there's an error. I'd need to understand more about the benefits, though, before considering such a change.

    0
  • Kevin Rathgeber

    From my point of view if an unhandled error is produced in the form, I would expect it to bubble up to the next available handler if there is one. So if an error occurs in a form and that portion of the form is not already in a Try/Catch I think closing it would be acceptable in order for the outer Try/Catch to catch it.

    0
  • Ken Lyon

    That makes sense to me, too. I think if we were starting from scratch that's likely the behaviour I'd want.

    0

Du måste logga in om du vill lämna en kommentar.