Hi all,

I have Mojolicious application with 10+ routes. Each route contains some API 
calls to external services.
So I wrote a helper to handle all API staff and now from my route I can just 
call $self->API(args). 
API always returns XML, which then turns into a hash with first node 'result' 
or 'error', so helper may return "{ result => { foo => 'bar' } }" or "{ error 
=> { foo => 'bar' } }". 

Having this scenario every time I'm calling API from route I have to check 
returned hash for "error" node and if it exists - render an error page (one and 
universal for all routes and API calls). It would be better if I could just 
check for it into helper and if an error occurs - render an error page right 
from helper, without any route processing. 

Is there any way do to this?

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to