if attrvalue.is_a? Hash
display_value = attrvalue[:"http://arvados.org/cwl#collectionUUID"] || attrvalue[:"arv:collection"] || attrvalue[:location]
re = CollectionsHelper.match_uuid_with_optional_filepath(display_value)
- locationre = CollectionsHelper.match(attrvalue[:location])
+ locationre = CollectionsHelper.match(attrvalue[:location][5..-1])
if re
- if locationre[4]
+ if locationre and locationre[4]
display_value = "#{Collection.find(re[1]).name} / #{locationre[4][1..-1]}"
else
display_value = Collection.find(re[1]).name
if m:
self.cap_cache(int(m.group(2)) * 128)
logger.debug("Creating collection reader for %s", locator)
- cr = arvados.collection.CollectionReader(locator, api_client=self.api_client,
- keep_client=self.keep_client,
- num_retries=self.num_retries)
+ try:
+ cr = arvados.collection.CollectionReader(locator, api_client=self.api_client,
+ keep_client=self.keep_client,
+ num_retries=self.num_retries)
+ except arvados.errors.ApiError as ap:
+ raise IOError(errno.ENOENT, "Could not access collection '%s': %s" % (locator, str(ap._get_reason())))
sz = len(cr.manifest_text()) * 128
self.collections[locator] = (cr, sz)
self.total += sz