Handle exceptions by PDO class

Added support for exception raising and exception logging otherwise i had no idea of what is going wrong