Revert "Removed FirebaseException." This reverts commit 522f3e13707a8a90810aa9d1165420604fc74358.
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/cd88ad1e Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/cd88ad1e Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/cd88ad1e Branch: refs/heads/master Commit: cd88ad1e75792ae31066fb4e52d660217958b4a6 Parents: 4d69eca Author: Andrea Cosentino <anco...@gmail.com> Authored: Fri Nov 25 12:50:16 2016 +0100 Committer: Andrea Cosentino <anco...@gmail.com> Committed: Fri Nov 25 12:50:16 2016 +0100 ---------------------------------------------------------------------- .../component/firebase/FirebaseConsumer.java | 4 +- .../firebase/exception/FirebaseException.java | 42 ++++++++++++++++++++ 2 files changed, 44 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/cd88ad1e/components/camel-firebase/src/main/java/org/apache/camel/component/firebase/FirebaseConsumer.java ---------------------------------------------------------------------- diff --git a/components/camel-firebase/src/main/java/org/apache/camel/component/firebase/FirebaseConsumer.java b/components/camel-firebase/src/main/java/org/apache/camel/component/firebase/FirebaseConsumer.java index e85b307..bbcb2b6 100644 --- a/components/camel-firebase/src/main/java/org/apache/camel/component/firebase/FirebaseConsumer.java +++ b/components/camel-firebase/src/main/java/org/apache/camel/component/firebase/FirebaseConsumer.java @@ -22,9 +22,9 @@ import com.google.firebase.database.DatabaseError; import com.google.firebase.database.FirebaseDatabase; import org.apache.camel.Exchange; import org.apache.camel.Processor; -import org.apache.camel.RuntimeCamelException; import org.apache.camel.component.firebase.data.FirebaseMessage; import org.apache.camel.component.firebase.data.Operation; +import org.apache.camel.component.firebase.exception.FirebaseException; import org.apache.camel.impl.DefaultConsumer; /** @@ -87,7 +87,7 @@ public class FirebaseConsumer extends DefaultConsumer { // send message to next processor in the route getProcessor().process(exchange); } catch (Exception e) { - throw new RuntimeCamelException("Message forwarding failed", e); + throw new FirebaseException("Message forwarding failed", e); } finally { // log exception if an exception occurred and was not handled if (exchange.getException() != null) { http://git-wip-us.apache.org/repos/asf/camel/blob/cd88ad1e/components/camel-firebase/src/main/java/org/apache/camel/component/firebase/exception/FirebaseException.java ---------------------------------------------------------------------- diff --git a/components/camel-firebase/src/main/java/org/apache/camel/component/firebase/exception/FirebaseException.java b/components/camel-firebase/src/main/java/org/apache/camel/component/firebase/exception/FirebaseException.java new file mode 100644 index 0000000..a39b871 --- /dev/null +++ b/components/camel-firebase/src/main/java/org/apache/camel/component/firebase/exception/FirebaseException.java @@ -0,0 +1,42 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.firebase.exception; + +/** + * Used to mark an exception occurred in the Firebase Camel processor. + */ +public class FirebaseException extends RuntimeException { + + /** + * Constructs a new runtime exception with the specified detail message and + * cause. <p>Note that the detail message associated with + * {@code cause} is <i>not</i> automatically incorporated in + * this runtime exception's detail message. + * + * @param message the detail message (which is saved for later retrieval + * by the {@link #getMessage()} method). + * @param cause the cause (which is saved for later retrieval by the + * {@link #getCause()} method). (A <tt>null</tt> value is + * permitted, and indicates that the cause is nonexistent or + * unknown.) + * @since 1.4 + */ + public FirebaseException(String message, Throwable cause) { + super(message, cause); + } + +}