LogSliceView gives a response of "end_line must be larger than start_line" when it really means "params missing"

RESOLVED FIXED

Status

P2
normal
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: emorley, Assigned: camd)

Tracking

Details

(Reporter)

Description

4 years ago
eg:
https://treeherder.mozilla.org/api/project/mozilla-inbound/logslice/

-> "end_line must be larger than start_line"

When it would be more clear to say:
-> "start_line and end_line params must be set" or similar

https://github.com/mozilla/treeherder-service/blob/f5c0b53e0ce6b527c5eb2d861adeb72e1e5859ea/treeherder/webapp/api/logslice.py#L48
        try:
            start_line = abs(int(request.QUERY_PARAMS.get("start_line", 0)))
            end_line = abs(int(request.QUERY_PARAMS.get("end_line", 0)))
        except Exception as e:
            return Response("parameters could not be converted to integers", 400)

        if start_line >= end_line:
            return Response("end_line must be larger than start_line", 400)
(Assignee)

Updated

4 years ago
Assignee: nobody → cdawson
(Assignee)

Updated

4 years ago
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.