Added exception message to sql error logging