Showing 1-4 of 4 messages
LiftRules.ajaxTimeoutFailure? Daniel Hobi 9/12/12 1:22 AM
Hi Lifters!

We are currently in a situation where an ajax call could...
1. simply time out.
2. get a 500 from our server.

LiftRules.ajaxDefaultFailure does currently not distinguish between these two cases afaik.

Therefore I thought that something like this would be cool...

LiftRules.ajaxTimeoutFailure = Full(() => JsCmds.Alert("Sorry, but our server is slow as hell."))
LiftRules.ajaxDefaultFailure = Full(() => JsCmds.Alert("Opps, that shouldn't happened. Please contact our support."))

...or is there already a possibility to get that functionality?


Re: LiftRules.ajaxTimeoutFailure? Daniel Hobi 9/13/12 12:23 AM
Just for the sake of is my solution:

//Provide own implementation of liftajax.js
LiftRules.renderAjaxScript = (session : LiftSession) => MyScriptRenderer.ajaxScript

//Add some LiftRules
MyLiftRules.ajaxTimeoutFailure = {
      Full(() => JsCmds.Alert("Timeout happened"))

MyLiftRules.ajaxSpecificFailure = List(
      (500, () => JsCmds.Alert("Error 500")),
      (404, () => JsCmds.Alert("Page not found"))

See a working example on github:

Re: [Lift] LiftRules.ajaxTimeoutFailure? David Pollak 9/13/12 11:21 AM
Sure. Please open a ticket.

Perhaps we should also have some kind of setting to allow for long Ajax requests.

Lift, the simply functional web framework:
Stuck? Help us help you:

Telegram, Simply Beautiful CMS
Lift, the simply functional web framework

Re: [Lift] LiftRules.ajaxTimeoutFailure? Daniel Hobi 9/14/12 5:33 AM
Done #1320. (

>> Perhaps we should also have some kind of setting to allow for long Ajax requests.
Ahh that would be great and exactly hit our needs! I think that this one deserves its own ticket? :-)