code: private void checkStorageState(StorageException e) {
          if (e.getCause() instanceof AmazonS3Exception) {
              String errorCode =
                  ((AmazonS3Exception) e.getCause()).getErrorCode();
              if (INVALID_OBJECT_STATE.equals(errorCode)) {
                  String message = "The storage state of this content item " +
                                   "does not allow for this action to be taken. To resolve " +
                                   "this issue: 1. Request that this content item be " +
                                   "retrieved from offline storage 2. Wait (retrieval may " +
                                   "take up to 5 hours) 3. Retry this request";
                  throw new StorageStateException(message, e);
              }
          }
      }
docs: Recognize and handle exceptions due to content which resides in Glacier
  but has not been retrieved for access.