Added better logging for exceptions

Added better logging for exceptions