camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [02/23] camel git commit: Fixing. send() method doesnot need to catch exceptions.
Date Wed, 23 Mar 2016 18:59:22 GMT
Fixing. send() method doesnot need to catch exceptions. 

Logging code is being removed. when throwing exception.

Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/5537bb59
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/5537bb59
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/5537bb59

Branch: refs/heads/master
Commit: 5537bb59355319bd9eebeb644258e9467952bb25
Parents: fcd1a49
Author: oalles <oalles@neivi.es>
Authored: Tue Mar 22 13:12:09 2016 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Wed Mar 23 18:46:10 2016 +0100

----------------------------------------------------------------------
 .../component/cm/CMSenderOneMessageImpl.java    | 20 ++++++--------------
 1 file changed, 6 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/5537bb59/components/camel-cm/src/main/java/org/apache/camel/component/cm/CMSenderOneMessageImpl.java
----------------------------------------------------------------------
diff --git a/components/camel-cm/src/main/java/org/apache/camel/component/cm/CMSenderOneMessageImpl.java
b/components/camel-cm/src/main/java/org/apache/camel/component/cm/CMSenderOneMessageImpl.java
index 813ed42..101905e 100644
--- a/components/camel-cm/src/main/java/org/apache/camel/component/cm/CMSenderOneMessageImpl.java
+++ b/components/camel-cm/src/main/java/org/apache/camel/component/cm/CMSenderOneMessageImpl.java
@@ -78,17 +78,11 @@ public class CMSenderOneMessageImpl implements CMSender {
 
         // See: Check https://dashboard.onlinesmsgateway.com/docs for responses
 
-        try {
-
-            // 1.Construct XML. Throws XMLConstructionException
-            final String xml = createXml(cmMessage);
+        // 1.Construct XML. Throws XMLConstructionException
+        final String xml = createXml(cmMessage);
 
-            // 2. Try to send to CM SMS Provider ...Throws CMResponse
-            doHttpPost(url, xml);
-        } catch (final RuntimeException e) {
-            LOG.error("Failed to send SMS: {}", cmMessage, e);
-            throw e; // XMLConstrucion o
-        }
+        // 2. Try to send to CM SMS Provider ...Throws CMResponse
+        doHttpPost(url, xml);
     }
 
     private String createXml(final CMMessage message) {
@@ -172,11 +166,9 @@ public class CMSenderOneMessageImpl implements CMSender {
             aTransformer.transform(src, dest);
             return xml.toString();
         } catch (final TransformerException e) {
-            LOG.error("Cant serialize CMMessage {}: ", message, e);
-            throw new XMLConstructionException(e);
+            throw new XMLConstructionException(String.format("Cant serialize CMMessage %s",
message), e);
         } catch (final ParserConfigurationException e) {
-            LOG.error("Cant serialize CMMessage {}: ", message, e);
-            throw new XMLConstructionException(e);
+            throw new XMLConstructionException(String.format("Cant serialize CMMessage %s",
message), e);
         }
     }
 


Mime
View raw message