I am implementing a RESTful API that calls a third party service that returns an XML response like so for a failure:
<Status>Failure</Status>
<ErrorContent>One or more do not exist</ErrorContent>
<ErrorNum>20</ErrorNum>
I want to return a 400
response to users of my API when a failure is returned from the third-party. What is the best way to do that? I could always check to see if Status
is Success
or Failure
and return accordingly, but it seems like there should be a better way to do it.