+htp #20705 allows javadsl creating custom rejections
This commit is contained in:
parent
2643857e82
commit
f49708d8b7
2 changed files with 6 additions and 1 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue