Reduce amount of information relayed on error to the front-end

Created on 27 January 2025, 2 months ago

Problem/Motivation

When πŸ› Drupal.org JSON API modules endpoint returns a 400 error when requested by the Project browser Active we could see that there was an error with the query. It is great that we could see that there was an error, but the front-end user doesn't probably need to have that much information in the front-end.

Steps to reproduce

Locally, you can go to src/Plugin/ProjectBrowserSource/DrupalDotOrgJsonApi.php and change this line:
'include' => 'field_module_categories,field_maintenance_status,field_development_status,uid,field_project_images',

to be
'include' => 'field_module_categories,field_maintenance_status,field_development_status,uid,field_project_images,another_non_existent_field',

Then clear the storage and query the front-end again.

Proposed resolution

Only display that there was an error in the front-end and log the full error via the logger service (watchdog or similar).

πŸ“Œ Task
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ͺπŸ‡ΈSpain fjgarlin

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024