Add query and notes to errors