-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Jun 22, 2010, at 2:45 AM, T.J. Crowder wrote:
> The answer is in the question. :-) If it's a non-HTTP error, it
> wouldn't be best practice to use an HTTP error code to represent the
> error. (Not that HTTP status codes don't have a fair bit of scope
> creep in them already.)

That's what I figured, but I wanted to make sure I was on the right track ...

> I've standardized by having *all* of my Ajax calls return data in the
> same way. They all return JSON-formatted data, and the format for
> success is always:

This is similar to what I was thinking.  In the end, I'll have a bit of 
framework I can use in other applications..

> In any given application, I tend to have a  wrapper around Prototype's
> ajax stuff with some problem-domain logic in it. That wrapper always
> checks for the `success` flag on calls and routes to the error handler
> if it's not there.

Which would, I suppose, extend the framework to be even more generic..  Hrm..  
Presumably this is just a simple subroutine call?  Not much of a performance 
hit, is it?

> FWIW,
> --
> T.J. Crowder

- ---------------------------
Jason 'XenoPhage' Frisvold
xenoph...@godshell.com
- ---------------------------
"Any sufficiently advanced magic is indistinguishable from technology."
- - Niven's Inverse of Clarke's Third Law



-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.14 (Darwin)

iEYEARECAAYFAkwiv9oACgkQ8CjzPZyTUTT8tQCeN87dhX+o0px6xNSKJJ/LbAWG
kMMAn1p5Q/E47IBcxG3/LrxEDm8HH0OD
=nQXW
-----END PGP SIGNATURE-----

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

Reply via email to