Skip to content

Commit

Permalink
Revise comments in 'tagObject'
Browse files Browse the repository at this point in the history
  • Loading branch information
doulikecookiedough committed Aug 15, 2024
1 parent 962ed5b commit a9fce58
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -556,23 +556,24 @@ public void tagObject(String pid, String cid) throws IOException, PidRefsFileExi
FileHashStoreUtility.checkForNotEmptyAndValidString(cid, "cid");

try {
// This method synchronizes the pid and cid
storeHashStoreRefsFiles(pid, cid);

} catch (HashStoreRefsAlreadyExistException hsrfae) {
// *** cid and pid already released ***
// cid and pid has been released
// This exception is thrown when the pid and cid are already tagged appropriately
String errMsg =
"HashStore refs files already exist for pid " + pid + " and cid: " + cid;
throw new HashStoreRefsAlreadyExistException(errMsg);

} catch (PidRefsFileExistsException prfe) {
// *** cid and pid already released ***
// cid and pid has been released
String errMsg = "pid: " + pid + " already references another cid."
+ " A pid can only reference one cid.";
throw new PidRefsFileExistsException(errMsg);

} catch (Exception e) {
// *** cid and pid already released ***
// cid and pid has been released
// Revert the process for all other exceptions
unTagObject(pid, cid);
throw e;
Expand Down

0 comments on commit a9fce58

Please sign in to comment.