You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2020/05/23 11:08:33 UTC

[camel] branch master updated: Improve the exception message if the collection does not exist on the database

This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/master by this push:
     new 36937a3  Improve the exception message if the collection does not exist on the database
36937a3 is described below

commit 36937a3e4f012c6cd70e7d3af54e2d35d58df61d
Author: Otavio R. Piske <an...@gmail.com>
AuthorDate: Sat May 23 12:53:29 2020 +0200

    Improve the exception message if the collection does not exist on the database
---
 .../main/java/org/apache/camel/component/mongodb/MongoDbEndpoint.java  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/components/camel-mongodb/src/main/java/org/apache/camel/component/mongodb/MongoDbEndpoint.java b/components/camel-mongodb/src/main/java/org/apache/camel/component/mongodb/MongoDbEndpoint.java
index a7e118a..0b8ad87 100644
--- a/components/camel-mongodb/src/main/java/org/apache/camel/component/mongodb/MongoDbEndpoint.java
+++ b/components/camel-mongodb/src/main/java/org/apache/camel/component/mongodb/MongoDbEndpoint.java
@@ -235,7 +235,8 @@ public class MongoDbEndpoint extends DefaultEndpoint {
         }
         if (collection != null) {
             if (!createCollection && !databaseContainsCollection(collection)) {
-                throw new CamelMongoDbException("Could not initialise MongoDbComponent. Collection " + collection + " and createCollection is false.");
+                throw new CamelMongoDbException("Could not initialise MongoDbComponent. Collection "
+                    + collection + " does not exist on the database and createCollection is false.");
             }
             mongoCollection = mongoDatabase.getCollection(collection, Document.class);