From 605f6dead8ecbdf141cae6ba9cf80a4c19e678e4 Mon Sep 17 00:00:00 2001 From: Lintterer Date: Thu, 28 Mar 2024 15:03:55 +0100 Subject: [PATCH] feat: add extended payload error logging --- build.sbt | 2 +- .../smithy4play/client/SmithyPlayClientEndpoint.scala | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index 5182b526..06915cad 100644 --- a/build.sbt +++ b/build.sbt @@ -1,6 +1,6 @@ import sbt.Compile import sbt.Keys.cleanFiles -val releaseVersion = sys.env.getOrElse("TAG", "1.0.1-Gamma") +val releaseVersion = sys.env.getOrElse("TAG", "1.0.1") addCommandAlias("publishSmithy4Play", "smithy4play/publish") addCommandAlias("publishLocalSmithy4Play", "smithy4play/publishLocal") addCommandAlias("generateCoverage", "clean; coverage; test; coverageReport") diff --git a/smithy4play/src/main/scala/de/innfactory/smithy4play/client/SmithyPlayClientEndpoint.scala b/smithy4play/src/main/scala/de/innfactory/smithy4play/client/SmithyPlayClientEndpoint.scala index 855c1fc4..d4a6d528 100644 --- a/smithy4play/src/main/scala/de/innfactory/smithy4play/client/SmithyPlayClientEndpoint.scala +++ b/smithy4play/src/main/scala/de/innfactory/smithy4play/client/SmithyPlayClientEndpoint.scala @@ -80,7 +80,10 @@ private[smithy4play] class SmithyPlayClientEndpoint[Op[_, _, _, _, _], I, E, O, .map(o => HttpResponse(response.statusCode, headers, o)) .leftMap { case error: PayloadError => - SmithyPlayClientEndpointErrorResponse(error.expected.getBytes(), response.statusCode) + SmithyPlayClientEndpointErrorResponse( + s"Parsing Error: Expected: ${error.expected} at Path: ${error.path.toString()}".getBytes(), + response.statusCode + ) case error: MetadataError => SmithyPlayClientEndpointErrorResponse(error.getMessage().getBytes(), response.statusCode) }