def METHOD_NAME(self, rule, param_name):
    try:
        return self.rules[rule].config[param_name].value
    except KeyError:
        if rule not in self.rules:
            raise RuleNotFoundError(rule, self) from None
        if param_name not in self.rules[rule].config:
            raise RuleParamNotFoundError(self.rules[rule], param_name, self) from None