Skip to content

JSON parsing error in Conan package upload, add rescue JSON::ParseError

  • Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA

What does this MR do and why?

This MR addresses an issue in the files_names method where invalid JSON data in the request body could lead to unexpected behavior. Implements a rescue block to catch JSON parsing exceptions during JSON parsing. Returns nil after a bad Request to prevent further processing and it uses safe navigation to handle potential nil json_payload after parsing error.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Related to #350172

Edited by 🤖 GitLab Bot 🤖

Merge request reports

Loading