mdedetrich commented on code in PR #376:
URL: 
https://github.com/apache/incubator-pekko-http/pull/376#discussion_r1433389812


##########
http/src/main/scala/org/apache/pekko/http/javadsl/unmarshalling/Unmarshaller.scala:
##########
@@ -124,6 +124,40 @@ object Unmarshaller extends 
pekko.http.javadsl.unmarshalling.Unmarshallers {
       implicit mi: JavaMapping[JI, SI]): unmarshalling.Unmarshaller[JI, O] =
     um.asInstanceOf[unmarshalling.Unmarshaller[JI, O]] // since guarantee 
provided by existence of `mi`
 
+  class UnsupportedContentTypeException(
+      private val _supported: java.util.Set[jm.model.ContentTypeRange],
+      private val _actualContentType: Optional[jm.model.ContentType])
+      extends RuntimeException(_supported.asScala.mkString(

Review Comment:
   Converting the java data-structures to Scala is done here so that the 
runtime exception message is the same as it is currently. This is done just 
incase currently existing code is matching against the exception message 
although one can argue that you shouldn't be doing this, furthermore if users 
are doing this its likely they will just be matching against `Unsupported 
Content-Type` in which case this will still work.
   
   In short, I am not against adjust the exception message so it just calls 
`.toString` on the Java data structures.



-- 
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]

Reply via email to