Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion perceval/backends/core/bugzillarest.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,24 @@ def call(self, resource, params):

logger.debug("Bugzilla REST client requests: %s params: %s",
resource, str(params))
r = self.fetch(url, payload=params, headers=headers)
try:
r = self.fetch(url, payload=params, headers=headers)
except requests.exceptions.HTTPError as e:
if e.response is not None and e.response.status_code == 400:
logger.warning(
"Bugzilla REST returned 400 for resource %s with params %s. "
"This usually indicates an invalid or too-large pagination offset.",
resource, params
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
resource, params
resource, str(params)

)
raise BackendError(
cause=(
"Bugzilla REST API returned HTTP 400 while paginating. "
"Pagination offsets may be too large or unsupported by the server."
)
)
raise



# Check for possible Bugzilla API errors
result = r.json()
Expand Down
3 changes: 3 additions & 0 deletions releases/1.4.6.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Bug fixes
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have to create changelog file. Please read the contributors guidelines: https://github.com/chaoss/grimoirelab/blob/main/CONTRIBUTING_WITH_CODE.md


- BugzillaREST now raises a BackendError when the Bugzilla API returns HTTP 400 during pagination, avoiding ambiguity between empty results and request failures.