On Feb 11, 10:27 pm, Margie Roginski <margierogin...@yahoo.com> wrote:
> I have a question about debugging django server side code in the case
> where the request is an ajax request.

>From the server-side POV, a request is a request is a request. Truth
is : there's no such thing as an "ajax request".

>  For example I have an
> autocomplete widget.  It makes a request to a particular url that
> takes me to one of my views.py functions, get_users(request).  If I
> have some sort of error in that function, I don't see the error
> anywhere and it just silently fails.

It's your client code that fails to handle the case properly.

>  If I explicitly put that url
> into the address bar then the error comes up in my browser, or if I
> use pdb to put a break point and then step through my code, I see the
> error.   In the case of an ajax request,

cf above.

> what happens to the error
> from the server code and is there any way to see it?

yes : look at the response content. Firebug is your friend - it lets
you trace and inspect XMLHttpRequests and their responses. Also, you
may want to have a "logging" middleware that logs unhandled errors -
this is useful both in dev or in production.

HTH

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to