The second sounds good to me, but i dont know really where to store it, my front end is REST and has no database connected to it, all the info i get its from microservices, so i need some sort of variable or environment space where to store the token when i receive it and retrieve it in the case of an error, there is anything like that in web2py?
El domingo, 2 de octubre de 2016, 11:59:13 (UTC-4), Anthony escribió: > > On Sunday, October 2, 2016 at 7:52:04 AM UTC-4, Luis Valladares wrote: >> >> Because my application has a microservice architecture, this means there >> is another app storing the token in the database and the only thing my >> web2py front end does is make a http request to that microservice and >> format the received data, but if during that formatting some exception is >> raised I lost all the content (in this case the token) that I want to send >> in request.cookies, this mean the user still have the old token when the >> microservice already have changed that token in their database. >> > > You could either wrap your web2py code in a try/except to ensure you catch > any errors directly, or use routes_onerror in routes.py to route any errors > to a separate error handling app/controller (in the latter case, you'll > need to make sure the relevant token data have been saved somewhere the > error handler can access). > > Anthony > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.