Cool, Thanks On 21/12/2008, at 6:20 PM, Marius wrote:
> > You already got good advices to your particular problem still an > exception thrown from LoanWrapper-s should be caught by and your > function called. I'll look into it tomorrow. > > > Br's, > Marius > > On 18 Dec, 23:58, Oliver <[email protected]> wrote: >> I was redirecting to an error page using >> LiftRules.logAndReturnExceptionToBrowser, but when I use a >> LoanWrapper >> to close a EntityManager and an error occurs when closing the entity >> manager, LiftRules.logAndReturnExceptionToBrowser doesn't appear to >> redirect to my error page. Can anyone think of a work around? >> >> // Output a simple error to the user. Link the error message >> to the screen via the current datetime >> LiftRules.logAndReturnExceptionToBrowser = { >> RedirectResponse("/error); >> } >> >> // Set up a LoanWrapper to automatically close a >> EntityManager >> if its open >> S.addAround(List( >> new LoanWrapper { >> def apply[T] (f : => T): T = { >> try { >> f >> } finally { >> EM.closeEM // close if open >> } >> } >> })) >> >> } > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Lift" 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/liftweb?hl=en -~----------~----~----~----~------~----~------~--~---
