Define Query#exec method and make sure that errors are raised from query responses