You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When Await() is used with a callback and errorCallback, an exception in the callback can trigger an errorCallback.
I think this is kind of counterintuitive - the errorCallback should be about the task you're awaiting on only, and you should either
A) get some kind of guarantee that only the completed callback or the error callback is going to be triggered or
B) completed callback will always be run, and error will only be run if there's an error in the Task
No workaround, but it should be easily resolved by moving completedCallback?Invoke() line outsideof the try/catch and adding a return after errorCallback invoke OR moving the completed callback to a finally block, depending on what behaviour is desired.
Relevant log output
Hello, World!
completed
Unrelated exception
The text was updated successfully, but these errors were encountered:
Description
When
Await()
is used with a callback and errorCallback, an exception in the callback can trigger an errorCallback.I think this is kind of counterintuitive - the errorCallback should be about the task you're awaiting on only, and you should either
A) get some kind of guarantee that only the completed callback or the error callback is going to be triggered or
B) completed callback will always be run, and error will only be run if there's an error in the Task
Steps to Reproduce
Platform with bug
Prism Core
Affected platforms
Windows
Did you find any workaround?
No workaround, but it should be easily resolved by moving completedCallback?Invoke() line outsideof the try/catch and adding a return after errorCallback invoke OR moving the completed callback to a finally block, depending on what behaviour is desired.
Relevant log output
Hello, World! completed Unrelated exception
The text was updated successfully, but these errors were encountered: