log query-error (fixes #173)