tesserae / apitess

Tesserae API
0 stars 4 forks source link

Enhancement: Find some way to distinguish error/fail states on /*/*/status/ endpoints #55

Open jeffkinnison opened 4 years ago

jeffkinnison commented 4 years ago

Even though this may seem kind of weird, it would be helpful to find some way to distinguish error states by HTTP code, i.e. "Done" can be 200, a traceback can be some kind of 500, etc. This could be helpful for quickly spotting problems that arise in searches behind the scenes.

nOkuda commented 4 years ago

In terms of API purity, I think we should shy away from responding with an HTTP error code when the resource requested (i.e., the status) is perfectly retrievable.

Instead, the resource itself should contain the error/fail state of the search job. In this case, the status resources have a field called "status" to indicate this information.

Admittedly, documentation on what to expect in the "status" field is non-existent. If you agree with my thinking on avoiding the use of HTTP error codes when responding with status objects, I'll update the documentation to clarify what to expect in the "status" field.

jeffkinnison commented 4 years ago

Yeah, enumerating the possible status fields would certainly help.