use of bio.terra.service.filedata.exception.DrsObjectNotFoundException in project jade-data-repo by DataBiosphere.
the class DrsService method parseAndValidateDrsId.
private DrsId parseAndValidateDrsId(String drsObjectId) {
DrsId drsId = drsIdService.fromObjectId(drsObjectId);
try {
UUID snapshotId = UUID.fromString(drsId.getSnapshotId());
snapshotDao.retrieveSummaryById(snapshotId);
return drsId;
} catch (IllegalArgumentException ex) {
throw new InvalidDrsIdException("Invalid object id format '" + drsObjectId + "'", ex);
} catch (SnapshotNotFoundException ex) {
throw new DrsObjectNotFoundException("No snapshot found for DRS object id '" + drsObjectId + "'", ex);
}
}
Aggregations