// observation for it.
try {
validOb = getNextObservation();
} catch (SQLException e) {
int uniqueId = source.getInt("unique_id");
InvalidObservation invalidOb = new InvalidObservation(
"Row with unique ID " + uniqueId, e
.getLocalizedMessage());
invalidOb.setRecordNumber(source.getRow());
invalidObservations.add(invalidOb);
continue;
}
// TODO: When we do more field validation here,
// we should do these checks in getNextObservation()
// and just throw an exception; something like ValidationError?
// May need to modify some validators to take types other than
// string. Actually, another approach is to read all fields as
// strings and then do *exactly* the same validation as for file
// sourced data.
if (validOb.getMagnitude().isBrighterThan()) {
InvalidObservation invalidOb = new InvalidObservation("JD "
+ validOb.getJD(),
"A \"Brighter Than\" observation.");
invalidObservations.add(invalidOb);
} else if (validOb.getHqUncertainty() != null
&& !uncertaintyRangePredicate.holds(validOb
.getHqUncertainty())) {
InvalidObservation invalidOb = new InvalidObservation("JD "
+ validOb.getJD(),
"HQ uncertainty value out of range "
+ uncertaintyRangePredicate.toString());
invalidObservations.add(invalidOb);
} else {