+htp #20705 allows javadsl creating custom rejections

This commit is contained in:
Konrad Malawski 2016-06-03 14:57:12 +02:00 committed by Johan Andrén
parent 2643857e82
commit f49708d8b7
2 changed files with 6 additions and 1 deletions

View file

@ -544,7 +544,7 @@ public class BasicDirectivesExamplesTest extends JUnitRouteTest {
//#mapRouteResult
}
public static final class MyCustomRejection implements akka.http.scaladsl.server.Rejection {}
public static final class MyCustomRejection implements CustomRejection {}
@Test
public void testMapRouteResultPF() {

View file

@ -27,9 +27,14 @@ import scala.collection.JavaConverters._
* A rejection encapsulates a specific reason why a Route was not able to handle a request. Rejections are gathered
* up over the course of a Route evaluation and finally converted to [[akka.http.scaladsl.model.HttpResponse]]s by the
* `handleRejections` directive, if there was no way for the request to be completed.
*
* If providing custom rejections, extend [[CustomRejection]] instead.
*/
trait Rejection
/** To be extended by user-provided custom rejections, such that they may be consumed in either Java or Scala DSLs. */
trait CustomRejection extends akka.http.scaladsl.server.Rejection
/**
* Rejection created by method filters.
* Signals that the request was rejected because the HTTP method is unsupported.