Make CodecException handling consistent

This commit makes CodecException handling consistent between functional
and annotation-based APIs. It now returns by default 4xx status code
for decoding error and 5xx for encoding error + print the error reason
in logs without the full stack trace in both variants.

Issue: SPR-15355
This commit is contained in:
Sebastien Deleuze
2017-04-10 15:56:15 +02:00
parent 15b5dd9f12
commit d098a4b96b
6 changed files with 46 additions and 11 deletions

View File

@@ -102,7 +102,7 @@ public class DispatcherHandlerErrorTests {
Mono<Void> publisher = this.dispatcherHandler.handle(exchange);
StepVerifier.create(publisher)
.consumeErrorWith(error -> assertSame(EXCEPTION, error))
.consumeErrorWith(error -> assertSame(EXCEPTION, error.getCause()))
.verify();
}