-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
requests_common.py should not raise an error when HTTP response code is greater than 299 #21
Comments
Echoing this, it would be beneficial to support returning results from I experienced a similar issue to that reported in this issue originally. There are instances where a REST API returns a 404, but it's not an error with the client's request. It simply indicates that no results were found. In cases such as this, a workflow utilizing the Something like a boolean switch " I'd be happy to submit a PR for this. |
This may be better handled by implementing a |
Sventec, be aware that fn_utilities has been deprecated and broken into smaller apps. You are encouraged to start using fn_rest_api as we still continue supporting this app. The operation is nearly identical with several improvements. One the improvements is a function input you're looking for. 'rest_api_allowed_status_codes' is used to list the allowed https status codes. So, "200, 202, 404" would all be considered allowed results without failing the workflow. Supporting 2XX for the entire range makes sense and we'll add that for future updates. You should also be aware of a global setting in the app.config to ensure any function failure doesn't fail a workflow: trap_exception. See it's usage below: [resilient] Best of luck. |
@mscherfling thank you for the callout on Appreciate the note on |
Description
I am using the
Utilities: Call Rest API
function in a resilient worklow. The workflow crashes with the following error message:This is because of the line 142 and 143 in request_common.py :
I believe an 404 error (HTTP 404 : ressource not found) should not raise an error in this function. This is not an integration error, this is just the client trying to fetch a ressource that does not exists. The client could handle this error code itself, rather than stopping the workflow. I believe this line should be removed.
Describe How to Reproduce
To reproduce this error, make a resilient workflow with the function
Utilities: Call Rest API
and try to get a resource that does not exists on the server. The workflow stops with an error, and there is nothing to be done to recover from this state without manual intervention on the workflow. If an error was not raised, the client could handle this error itself and the workflow would not stop in this case.The text was updated successfully, but these errors were encountered: