playframework/playframework — pull request #3516 by julienrf (2014-10-16 08:13:56+00:00)
Title: Give more control to users on the error value of the JsResult filtering methods

The current `filter` method of `JsResult` allows users to supply a custom `ValidationError` to use in case target value is filtered out. In such a case the resulting `JsResult` value is `JsError(validationError)`. The problem with this implementation is that it does not allow users to associate a `JsPath` to the validation error.

This PR fixes this issue by changing the `filter` method so that it takes a `JsError` as parameter. Users can now write `jsResult.filter(JsError(__ \ "foo", "error message"))(predicate)`, so that the `JsError` can have a custom path.

The same applies to `filterNot`.