Updates to error logging to represent accurate queries and errors