Not a bug Server error if Elasticsearch is not running

AndyB

Well-known member
Affected version
Enhanced search v2.2.2
If Elasticsearch is not running and you try to do a search the following server error is displayed:

1638552489400.png

If Elasticsearch is not running, it would be better to return this error phrase:

return $this->error(\XF::phrase('xfes_elasticsearch_server_could_not_be_reached'));
 
Last edited:
The error shows on the front end to any logged in member but only if debug mode is enabled.
I was observing different behavior: the trace was showing even with debug mode disabled.

Looking at \XF\ControllerPlugin\Error::actionException, it seems the logic is to display the error if the site is in debug mode or the current visitor is an admin. Otherwise, a generic error with no trace will be displayed.
 
Back
Top Bottom