i'm writing a PCF that calls a code activity.
in the ode activity i want to throw exceptions of 2-3 types and i want to differentiate between them with a simple condition
is it possible to add errorType, or any other field to the exceptions returned from the code activity? is there any documentation on this?
thank you
The challenge here is that you don't have control over the code that is returned and you can set the message returned only.
That is why I used this approach to differentiate between different issues that could occur at the backend.
hmmm... that means all the calls to the backend return 200, even though some of them are failures, right?
is this the best practice in dynamics?
Hello,
I usually use the following approach:
1. In the action or custom api (I believe this is what you are talking about) I introduce new properties like "Success (bool)", "ErrorMessage (string)".
2. When something goes wrong in the codebehind I just set Success to false and pass ErrorMessage that contains the description of what exactly wrong.
3. Use Success/ErrorMessage in clientside code.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156