Closed kittsville closed 9 years ago
Investigation shows this does not appear to happen with Dash page and Dash action request failures.
The issue is that I presumed the jQuery.ajax.fail
callback was only called when the AJAX request failed due to a connection issue. This issue arises when the PHP fails and thus the server returns 500 (internal server error), meaning the AJAX request failed.
All I need to do is properly inspect the response in the fail
callback and take appropriate action to inform the user/developer what's happened.
While this'll make the already a bit shoddy AJAX function messier it's a necessary fix ahead of the refactoring of all scripts, which itself is held back by the porting of KitPipe's functionality over to the WP-Librarian Dev Kit. I'll make an issue anyway and link them all together to keep clear track of what needs doing where.
See #47 for plugin-wide script refactoring
For some time errors have not been correctly reported by Dashboard AJAX. Errors that result in malformed JSON are being reported as the server being down (Unable to contact $site_name The website may be down or you may be having connection issues). This is probably just a minor issue with
wp_lib_send_ajax()
.