Adding Error Reporting

I added lines to return sql errors to the console for debugging.