Comment 2 for bug 1305352

Revision history for this message
Jono M (jonom) wrote :

(3) seems the most robust - that would be my preference. sendjsonrequest() (mahara.js:202) seems to be used pretty much universally for AJAX requests but error callbacks aren't given most of the time. However, if an error callback is given it is called in pretty much any situation (XHR error, invalid JSON, JSON with an 'error' property, etc.)

I notice that function already uses displayMessage() to display errors in some circumstances, but there are quite a few when it relies on the error callback to display anything.

It would be nice to replace the spinner with an error message, but a simple fix could be to modify that function so that that a message is displayed at the top of the screen whenever it encounters an error. It wouldn't make the spinner go away, but it would at least be an indicator that something went wrong.