I am currently working on a project which requires data fetching from a 3rd party closed API (over SOAP).
Currently I'm in a situation where I have to do argument and data validation inside our application code, because the mentioned 3rd party API does not return anything relating to errors. Examples:
Request something with a malformed query arg (e.g.
12345): API returns null, hence not telling me what actually broke the request.
Request with no query args, while the API expects some args: API returns null, so I'm again in the dark about what is going on.
The API can return a collection of data, or a single piece of data. How it handles "no data found": returns null like in all those error cases. This way I do not know whether there actually is nothing to find or whether the API broke again.
I've been trying various things and mapping out what works and what does not. I have got some example request responses from the API provider so at least I know what successful request responses look like.
Are there any good ways to handle situations like these when I just can't ask the API provider to implement proper error handling or similar approaches?
Should I just continue experimenting and wasting time while implementing the validation logic inside our application logic (which should then be abstracted in case the API itself changes or is dumped)?
(I posted this to SE Programmers instead of SO as this is not about a specific technical implementation detail, but about a way of handling the issue in general.)