Current behaviour of ~> on a ParamFailure is to override the parameter with the new parameter passed to >. This means that when applying two successive >, the last application will be used. This is in contrast to the current behaviour of ?, which only use the first application, and ignore the following ones (if the Box is already a Failure, applying ? will return the same failure).
A use case illustrating the poential issue:
for {
id <- S.param("id") ?~ "Missing id" > 400
item <- (DB.find(id) ? "Item not found" > 404).filter(canViewItem) ? "Unauthorized access to item" ~> 403
} yield ???
In case the item id is not in the DB, the message will be "item not found" along with error code 403, which is very counter-intuitive.
Discussion started in the google group: https://groups.google.com/forum/#!topic/liftweb/IMJqy2aMtXk
Current behaviour of ~> on a ParamFailure is to override the parameter with the new parameter passed to
>. This means that when applying two successivewill return the same failure).>, the last application will be used. This is in contrast to the current behaviour of ?, which only use the first application, and ignore the following ones (if the Box is already a Failure, applying ?A use case illustrating the poential issue:
for {
id <- S.param("id") ?~ "Missing id"
> 400"Item not found"item <- (DB.find(id) ?
> 404).filter(canViewItem) ?"Unauthorized access to item" ~> 403} yield ???
In case the item id is not in the DB, the message will be "item not found" along with error code 403, which is very counter-intuitive.
Discussion started in the google group: https://groups.google.com/forum/#!topic/liftweb/IMJqy2aMtXk