Ajax commands fail silently if there was an exception

Created on 23 May 2015, over 9 years ago
Updated 22 May 2024, 7 months ago

If the request made for an AJAX command crashes, the browser doesn't show any kind of error and the user is left wondering whether the site is just being REALLY slow.

This happens for example:

- views preview, if there's a problem such as a developer making mistakes in the declaration of views data, or in views handler code
- taxonomy autocomplete

🐛 Bug report
Status

Closed: outdated

Version

11.0 🔥

Component
Ajax 

Last updated 2 days ago

Created by

🇬🇧United Kingdom joachim

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇬🇧United Kingdom joachim

    This is not just Views preview - it's all AJAX commands.

  • 🇺🇸United States TolstoyDotCom L.A.

    This is perhaps an example of the problem: https://github.com/TolstoyDotCom/drupal_use_ajax_example

    I haven't looked into whether 'use-ajax' already has a way to deal with such things and I haven't looked into how to spot such issues from the Javascript side.

    I don't think it would be a good idea to let the user know the specific error message or show a stack trace, but showing something like 'An error occurred, please contact an administrator' in the dialog would be a good idea.

  • 🇮🇳India sukr_s

    Not an issue any more. On crash (wrong function call or db crash) in Ajax call, the following error message is displayed

    Oops, something went wrong. Check your browser's developer console for more details.

    Tested on 10.2.5

  • Status changed to Closed: outdated 7 months ago
Production build 0.71.5 2024