From d12f33e1e801a6893083cf57cf516d0f74da53fd Mon Sep 17 00:00:00 2001 From: "Michael S. Klishin" Date: Fri, 8 Jun 2012 22:14:59 +0400 Subject: [PATCH] Better authentication failure message --- src/monger/core.clj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/monger/core.clj b/src/monger/core.clj index dc4bc06..2f03392 100644 --- a/src/monger/core.clj +++ b/src/monger/core.clj @@ -88,7 +88,7 @@ (monger.core/get-db connection \"myapp_production\")" ([^String name] (.getDB *mongodb-connection* name)) - ([^Mongo connection, ^String name] + ([^Mongo connection ^String name] (.getDB connection name))) @@ -206,7 +206,7 @@ (set-connection! conn) (when (and user pwd) (when-not (authenticate (.getName db) user pwd) - (throw (IllegalArgumentException. "Could not authenticate. Either database name or credentials are invalid.")))) + (throw (IllegalArgumentException. (format "Could not authenticate. Either database name or credentials are invalid. Database name: %s, username: %s" (.getName db) user))))) ;; only do this *after* we authenticated because set-db! will try to set up a default GridFS instance. MK. (when db (set-db! db))