add options to error messages and raise in query_builder