You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.
View groupJoin the community to find out what other Atlassian users are discussing, debating and creating.
I have this code snippet which will call an API and return a list of Users in List format:
return http.request(Method.GET, ContentType.JSON) {
uri.path = USERS_ENDPOINT
} as List<Map>
That example will work perfectly if there is no problem with the API. Now I want to handle the case where this API returns an error (such as 401, 500):
I have tried this but it does not work:
http.request(Method.GET, ContentType.JSON) {
uri.path = USERS_ENDPOINT
response.success { res, reader ->
return reader as List<Map>
}
response.failed {
// do somthing here, a logging for example
log.warn "Failed"
}
}
// the next statement I want to execute after the API call has been failed
Any idea on this?
Happy New Year! We hope you all had a safe and restful holiday season. 2020 was a unique year full of unforeseen events; however, as we enter the new year of 2021, we’re optimistic for the light at t...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events