For helping in debugging, you could use log4net to intercept NHibernate logs. That would help with trouble shooting.
For instance, if you had a malformed password you would get an ADOException forces by the database itself. Unfortunately, thet won't log in you NHibernate logs all you'll see is something like this:
NHibernate.Connection.DriverConnectionProvider [(null)] - Obtaining IDbConnection from Driver
...and then the log stops.
I'm using Oracle, so even if the database can't be found I'll still get an Oracle exception back as an ADOException (TNS not resolved). From NHibernate's perspective it will look the same:
DEBUG NHibernate.Connection.DriverConnectionProvider [(null)] - Obtaining IDbConnection from Driver
For failed connections and authentication you won't see an exception until you try to begin a new transaction or flush a transient object to the database. That being said, you could force a check of the connection with something like this:
Code:
session.Connection.Open();
If the database can't be found or authentication is bad and ADOException would be raised when forcing the Open().
So, beging transaction or a forced open would raise the exception and allow you to do a check before continuing execution.
Does that do it for you?