Wrap AJAX errors in an AJAX wrapper & only remove AJAX errors.
Fixes #6957