Otherwise, if another field is not parsed correctly, we risk triggering
another exception while attempting to use the unset zone name in the
error report.
Signed-off-by: Miod Vallat <miod.vallat@powerdns.com>
di.backend = this;
- try {
- pdns::checked_stoi_into(di.id, row[0]);
- }
- catch (const std::exception& e) {
- g_log << Logger::Warning << __PRETTY_FUNCTION__ << " could not convert id '" << row[0] << "' for zone '" << di.zone << "' into an integer: " << e.what() << endl;
- continue;
- }
-
try {
di.zone = ZoneName(row[1]);
}
continue;
}
+ try {
+ pdns::checked_stoi_into(di.id, row[0]);
+ }
+ catch (const std::exception& e) {
+ g_log << Logger::Warning << __PRETTY_FUNCTION__ << " could not convert id '" << row[0] << "' for zone '" << di.zone << "' into an integer: " << e.what() << endl;
+ continue;
+ }
+
try {
di.catalog = ZoneName(row[5]);
}