Using Throw API Exception Step
- 28 Aug 2023
- 1 Minute to read
- Print
- DarkLight
Using Throw API Exception Step
- Updated on 28 Aug 2023
- 1 Minute to read
- Print
- DarkLight
Article summary
Did you find this summary helpful?
Thank you for your feedback
Example Lab Article
While Example Lab projects are resources for public use, articles and assets are not actively maintained. Screenshots and features are from the specified version below. These references may become dated as new versions are released.
Overview
Example Lab Details | |
Version | 6.12.1 |
Root Folder | Example Lab - API Exception |
Modules | None |
Dependencies | None |
This Example Lab project demonstrates how to use the Throw API Exception Step
Explanation
This Flow has one input of the type Integer. This input is passed to an Equals (Number) Rule that checks if it is equal to 1. If it is the Flow completes. If it's not, the flow goes to the Throw API Exception Step, which throws an exception with the message "wrong number, try 1" and code 400. If this Flow as called as a REST service, this code and message are what is returned. The message and status code can be set on the step to customize how a Flow returns errors when called as a REST service.
Reference Articles
Project Download
The examples attached were developed to be instructional and were not developed as officially supported components. For more information or to engage our service team to develop fully supported, production-quality solutions, please contact services@decisions.com. Import the project below to a Decisions environment on version 6.12.1 or later using our Importing/Exporting article.
Was this article helpful?