mdedetrich commented on code in PR #376:
URL:
https://github.com/apache/incubator-pekko-http/pull/376#discussion_r1433425460
##########
http/src/main/scala/org/apache/pekko/http/javadsl/unmarshalling/Unmarshaller.scala:
##########
@@ -85,8 +84,9 @@ object Unmarshaller extends
pekko.http.javadsl.unmarshalling.Unmarshallers {
val mediaType = t.asScala
if (entity.contentType == ContentTypes.NoContentType ||
mediaType.matches(entity.contentType.mediaType)) {
um.asScala(entity)
- } else
FastFuture.failed(UnsupportedContentTypeException(Some(entity.contentType),
- ContentTypeRange(t.toRange.asScala)))
+ } else FastFuture.failed(
+
pekko.http.scaladsl.unmarshalling.Unmarshaller.UnsupportedContentTypeException(Some(entity.contentType),
Review Comment:
So I had to undo this change because using a single inline import makes the
code fail to compile on Scala 3 due to
```
[error] -- [E049] Reference Error:
/home/runner/work/incubator-pekko-http/incubator-pekko-http/http/src/main/scala/org/apache/pekko/http/javadsl/unmarshalling/Unmarshaller.scala:88:33
[error] 88 | } else
FastFuture.failed(UnsupportedContentTypeException(Some(entity.contentType),
```
A better alternative might be to throw the `javadsl` variant however this is
technically a behavioural change (hypothetically users may be relying on the
scala specific features of scaladsl when catching the exception).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]