Exception is now printed via logger
Created class to handle database writes