// after the RR class below.
}
- boost::scoped_ptr<RRClass> rrclass;
- try {
- rrclass.reset(new RRClass(rrparam_token.getString()));
+ RRClass rrclass(zone_class_);
+ if (rrclass.fromText(rrparam_token.getString())) {
+ if (rrclass != zone_class_) {
+ // It doesn't really matter much what type of exception
+ // we throw, we catch it just below.
+ isc_throw(isc::BadValue, "Class mismatch: " << rrclass <<
+ "vs. " << zone_class_);
+ }
rrparam_token = lexer_.getNextToken(MasterToken::STRING);
- } catch (const InvalidRRClass&) {
- // If it's not an rrclass here, use the zone's class.
- rrclass.reset(new RRClass(zone_class_));
}
// If we couldn't parse TTL earlier in the stream (above), try
rrparam_token = lexer_.getNextToken(MasterToken::STRING);
}
- if (*rrclass != zone_class_) {
- isc_throw(InternalException, "Class mismatch: " << *rrclass <<
- "vs. " << zone_class_);
- }
-
// Return the current string token's value as the RRType.
return (RRType(rrparam_token.getString()));
}