trigger query result before throwing exceptions