Closed caxap closed 12 years ago
What's the point of returning AjaxError instead of raising?
catch()
taking multiple exceptions look useful, but why take junk and then filter it out?
Also, please don't rename e
to exc
.
ajax.error()
instead of raising, for which I see no use. Even if there were some use, such a strange behavior as returning exceptions should be avoided not encouraged. Also, your code will result in {"success": true, ...}
response upon AjaxError
return which is very confusing.catch()
should raise errors.There are parts of Zen of Python about 1 and 2:
Giving all of that, the only thing from this patch that I see as useful and will willingly accept is multiple arguments for catch()
So, updated! I use slightly modified version of ajax decorator and in my case these changes make sense. I'm agree that in your case it looks redundant.
Anyway, there is no name clash there.
actually it was, name "e" was used in filtering and in except statements, and yes there are no any side effects from this hiding.
Can you, please, rebase your branch to make patch cleaner?
Also, if you don't mind can you share a code of your view or views that required things you submitted? This is not necessary, just curious. A gist would be perfect.
Merged manually in 3b1ee864da