4 ms·
You are writing a client for an API, to be deployed at scale. The API returns objects of type A or B, but occasionally returns something else - not as an error,
by Retr0id 4y ago
You are writing a client for an API, to be deployed at scale. The API returns objects of type A or B, but occasionally returns something else - not as an error, it's just what happens to be in the server's database. You'd still write code and test-cases to deal with the not-A-or-B instances, right?
- thrown_22 4y ago>You'd still write code and test-cases to deal with the not-A-or-B instances, right? I've seen this one before. It was called the something something solution and was very popular in Germany a while back.
- fallingknife 4y agoBut this is not an API and it is a disorder so equivalent to an error. But who says you wouldn't want to handle it in either case?