Added more logging info to SQL erors