From ccfdeef530f4150a033b23e42478602d3ca5254f Mon Sep 17 00:00:00 2001 From: faustin0 Date: Tue, 15 Nov 2022 10:32:09 +0100 Subject: [PATCH] more descriptive error message --- core/src/main/scala/jms4s/jms/MessageFactory.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/scala/jms4s/jms/MessageFactory.scala b/core/src/main/scala/jms4s/jms/MessageFactory.scala index 9b9885ca..9b84bf10 100644 --- a/core/src/main/scala/jms4s/jms/MessageFactory.scala +++ b/core/src/main/scala/jms4s/jms/MessageFactory.scala @@ -51,12 +51,12 @@ class MessageFactory[F[_]](private val context: JmsContext[F]) extends AnyVal { from.getJMSReplyTo.traverse_ { case queue: Queue => to.setJMSReplyTo(new JmsQueue(queue)) case topic: Topic => to.setJMSReplyTo(new JmsTopic(topic)) - case _ => Failure(new RuntimeException("Unsupported destination")) + case d => Failure(new RuntimeException(s"Unsupported destination: $d")) }, from.getJMSDestination.traverse_ { case queue: Queue => to.setJMSDestination(new JmsQueue(queue)) case topic: Topic => to.setJMSDestination(new JmsTopic(topic)) - case _ => Failure(new RuntimeException("Unsupported destination")) + case d => Failure(new RuntimeException(s"Unsupported destination: $d")) }, from.getJMSDeliveryMode.traverse_(to.setJMSDeliveryMode), from.getJMSRedelivered.traverse_(to.setJMSRedelivered),