Search in sources :

Example 1 with DrsObjectNotFoundException

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);
    }
}
Also used : InvalidDrsIdException(bio.terra.service.filedata.exception.InvalidDrsIdException) SnapshotNotFoundException(bio.terra.service.snapshot.exception.SnapshotNotFoundException) DrsObjectNotFoundException(bio.terra.service.filedata.exception.DrsObjectNotFoundException) UUID(java.util.UUID)

Aggregations

DrsObjectNotFoundException (bio.terra.service.filedata.exception.DrsObjectNotFoundException)1 InvalidDrsIdException (bio.terra.service.filedata.exception.InvalidDrsIdException)1 SnapshotNotFoundException (bio.terra.service.snapshot.exception.SnapshotNotFoundException)1 UUID (java.util.UUID)1