Log error message when execute sql failed