View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0025384 | mantisbt | api rest | public | 2019-01-25 14:12 | 2019-01-31 02:57 |
Reporter | obmsch | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | confirmed | Resolution | open | ||
Product Version | 2.19.0 | ||||
Summary | 0025384: Get issues: Inconsistent error handling/reporting | ||||
Description | The different flavors of 'Get Issues' with restrictions (issue_id, project_id, filter_id) handle missing entities inconsistent.
| ||||
Tags | No tags attached. | ||||
related to | 0025406 | confirmed | Get Filter API should return errors when filter is not found or filter id invalid |
To get at least rid of the 500 in (3.) the call
in 'mc_filter_get_issues' (api\soap\mc_filter_api.php) should be replaced with
Then (3.) is put on par with (4.) and returns |
|
As I am no specialist in designing REST API's, @vboctor what @obmsch wrote at 0025384:0061300 is certainly better than what we have now, and is the same way how the similar function I am note complete sure if HTTP status 200, 'OK' in combination with some more status information in response is the right way to deal with it, or if HTTP code 404 is also the right one for cases 3. and 4. |
|
Thanks @obmsch for reporting the bug. The correct behavior is as follows:
Often the differences in behaviors occur due:
So in short all errors should behave like case 1 and 2 in 0025384:0061300 The same kind of behaviors should apply to other APIs, e.g. Getting a filter by id - which currently returns success and empty array when filter id is not found or is invalid. But this can be a different bug. Pull Requests are welcome, if not, I will try to get to around to fixing this at some point. |
|
I have reported bug 0025406 for get filter by id error handling and linked it to this issue. |
|
@vboctor strings are not invalid in general. There are some hardcoded allowed values, see Of course, it's a bit inconsistent as in |
|