Error management when server is down

Created on 3 May 2024, 7 months ago
Updated 17 May 2024, 6 months ago

Problem/Motivation

When the endpoint is down, and you go to a direct link of a search result page (because someone gave it to you for example), you get a white page "unexpected error". The log shows why:

TypeError: Drupal\openwoo_search\Plugin\OpenWooSearch\OpenWooApp::getPublicationValues(): Argument #1 ($publication) must be of type object, null given, called in /var/www/testing.dvgemdemo.hosted-temp.com/releases/20240502142349-test-2358330/htdocs/modules/contrib/openwoo/modules/openwoo_search/src/Plugin/OpenWooSearch/OpenWooApp.php on line 174 in

Steps to reproduce

Hard to reproduce, but add a check if the $publication is an object to catch this error.
You can reproduce some of it by finding a real serach result page, and than changing the endpoint to an endpoint the publication is not available on and the api key is not accepted on.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇳🇱Netherlands joshahubbers

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