check for different strings in exception message
flip strings for correct regex matching
Merge pull request #548 from darkv/db_connection_patch

Connection validation, auto reconnect