For an error handling of let’s say a a backend service being inaccessible, I want to return a 503 Service Unavailable error in my HTTP header accompanied by a response in application/json format.
I was able to do this successfully using setResponse2 (for the content type) and setResponseCode (for the HTTP header).
However, when I test this in Designer, I keep getting the prompt saying “Server connection to ‘localhost’ lost. Try restoring session later.” It seems that Designer is acknowledging my forced 503 Service Unavailable error as an error it encountered, even though it should be the one returning this error.
I’ve observed this when trying to return a series of 5xx HTTP status codes.
Wanted to check if there is a workaround on how to suppress this as when I test using SoapUI or Postman, I’m able to receive the expected response. For those unfamiliar with the service though and they encounter this in Designer, this can be disconcerting as they may think something’s wrong with their server.