I'd like to put this post back up, hoping for a reply...

Alexandre Conrad wrote:

> Hi,
> 
> I would like to know how errors should be handled having webservices 
> running with XMLRPCController.
> 
> Say I have a "def login(self, user, password)" method. If the login 
> fails, how should I return the errors to the client? I saw, from the 
> following docs:
> 
>    http://wiki.pylonshq.com/display/pylonsdocs/Using+the+XMLRPCController
> 
> that a convenient fault handler function is provided:
> 
> def xmlrpc_fault(code, message):
>      """Convenience method to return a Pylons response XMLRPC Fault"""
> 
> So I imported this function in my controller:
> 
> from pylons.controllers.xmlrpc import xmlrpc_fault
> 
> and added to my login method:
> 
> user = model.User.query.filter_by(user=user, password=password).one()
> if not user:
>      return xmlrpc_fault(LOGIN_ERR, "incorrect login")
> 
> Is this how it should be handled ? If it is, I have the following error 
> message:
> 
> exceptions.TypeError: cannot marshal <class 
> 'paste.wsgiwrappers.WSGIResponse'> objects
> 
> Regards,

-- 
Alexandre CONRAD


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to