Amend log message on query execution failure