#10841: Better 500 template for AJAX calls --------------------------------------------------+------------------------- Reporter: Riz <m.syc...@axion-rti.ru> | Owner: nobody Status: new | Milestone: Component: Core framework | Version: 1.0 Resolution: | Keywords: Stage: Unreviewed | Has_patch: 0 Needs_docs: 0 | Needs_tests: 0 Needs_better_patch: 0 | --------------------------------------------------+------------------------- Changes (by Glenn):
* cc: gl...@zewt.org (added) Comment: This issue is a frustration for everyone doing AJAX with Django. I hope this gets fixed. I don't think errors should be returned as a broken-apart JSON string. It would make testing with curl, etc. harder, and it doesn't seem useful for clients to try to figure out why the server crashed. I could see a case for wrapping the entire templated error into JSON, but I think it's simpler for the client to just assume that 500 errors return plaintext, and do something like: {{{ new Ajax.Request("/ajax.json", { on500: function(resp) { $("error").update(resp.responseText.replace("\n", "<br>")); } onSuccess: function(resp) { f(resp.responseJSON); } }); }}} ... to display errors in the page, even when the normal response is JSON. -- Ticket URL: <http://code.djangoproject.com/ticket/10841#comment:7> Django <http://code.djangoproject.com/> The Web framework for perfectionists with deadlines. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-updates?hl=en -~----------~----~----~----~------~----~------~--~---