How Can I Get Better Errors From A Flow API
Comments
-
Do you have a recommended way for your clients who use the API when it comes to handling (deserializingparsing) the Fault exceptions thrown?
Examples
[i]System.ServiceModel.FaultException
1[DecisionsFramework.ServiceLayer.Utilities.FrameworkFault]: Object reference not set to an instance of an object. (Fault Detail is equal to DecisionsFramework.ServiceLayer.Utilities.FrameworkFault).[/i] [i] [/i] [i]System.ServiceModel.FaultException
1[DecisionsFramework.ServiceLayer.Utilities.FrameworkFault]: [SecurityException] Username/Password is invalid. (Fault Detail is equal to DecisionsFramework.ServiceLayer.Utilities.FrameworkFault).[/i]
[i] [/i]
[i]System.ServiceModel.FaultException`1[DecisionsFramework.ServiceLayer.Utilities.FrameworkFault]: Exception of type DecisionsFramework.ServiceLayer.InvalidUserSessionException was thrown. (Fault Detail is equal to DecisionsFramework.ServiceLayer.Utilities.FrameworkFault).[/i]
[i]
[/i]
[i]
[/i]
These error messages dont tell us much on their own, and the full error message data only shows up in the Decisions UI. -
[font=Roboto, Arial, Helvetica, sans-serif]You can use a Catch Exception step in the flow youre calling, place a Create Data step after it, and generate a JSON-formatted error message to pass into the flows output. You can then check for an error in that output from the API call in the external code.[/font]
[font=Roboto, Arial, Helvetica, sans-serif]
[/font]
[font=Roboto, Arial, Helvetica, sans-serif]Attached is a rough example of how to configure a flow to return a JSON error message. You can specify a response code to work with if the flow returns an error, but the call itself will have a 200 response.[/font]
Howdy, Stranger!
Categories
- 2.1K All Categories
- 17 General
- 154 Installation / Setup
- 988 Flows
- 86 Rules
- 199 Administration
- 203 Portal
- 430 General Q & A
- 596 Forms
- 282 Reports
- 3 Designer Extensions
- 38 Example Flows
- 32 CSS Examples
- 1 Diagram Tile
- 5 Javascript Controls
- 137 Pages
- 1 Process Mining
- New Features
- 147 Datastructures
- 49 Repository
- 165 Integrations
- 25 Multi-Tenant
- 21 SDK
- 39 Modules
- 36 Settings
- 19 Active Directory
- 12 Version 7
- 34 Version 8