This renames SqlException to SqlError (to be more consistent with how Python names exceptions), and adds an utility function which logs a few more useful details about errors. See #3004