Skip to content
Snippets Groups Projects
Commit 80691ee7 authored by Franz Knuth's avatar Franz Knuth
Browse files

caching_backend: increased verbosity of error message when adding values to closed sections

and extended to the routines handling arrays
parent 9cb1f0cb
No related branches found
No related tags found
No related merge requests found
...@@ -144,21 +144,27 @@ class CachingSectionManager(object): ...@@ -144,21 +144,27 @@ class CachingSectionManager(object):
try: try:
self.openSections[gI].addValue(valueMetaInfo, value) self.openSections[gI].addValue(valueMetaInfo, value)
except: except:
raise Exception("Cannot add value to section %d (%d) of %s, as it is not open" % (gI, gIndex, self.metaInfo.name)) raise Exception("Cannot add value for metadata %s to section %d (%d) of %s, as it is not open" % (valueMetaInfo.name, gI, gIndex, self.metaInfo.name))
def setArrayValues(self, valueMetaInfo, value, offset = None, gIndex = -1): def setArrayValues(self, valueMetaInfo, value, offset = None, gIndex = -1):
if gIndex == -1: if gIndex == -1:
gI = self.lastSectionGIndex gI = self.lastSectionGIndex
else: else:
gI = gIndex gI = gIndex
try:
self.openSections[gI].setArrayValues(valueMetaInfo, value, offset) self.openSections[gI].setArrayValues(valueMetaInfo, value, offset)
except:
raise Exception("Cannot set array values for metadata %s to section %d (%d) of %s, as it is not open" % (valueMetaInfo.name, gI, gIndex, self.metaInfo.name))
def addArrayValues(self, valueMetaInfo, value, offset = None, gIndex = -1): def addArrayValues(self, valueMetaInfo, value, offset = None, gIndex = -1):
if gIndex == -1: if gIndex == -1:
gI = self.lastSectionGIndex gI = self.lastSectionGIndex
else: else:
gI = gIndex gI = gIndex
try:
self.openSections[gI].addArrayValues(valueMetaInfo, value) self.openSections[gI].addArrayValues(valueMetaInfo, value)
except:
raise Exception("Cannot add array values for metadata %s to section %d (%d) of %s, as it is not open" % (valueMetaInfo.name, gI, gIndex, self.metaInfo.name))
class CachingDataManager(object): class CachingDataManager(object):
def __init__(self, metaInfo, superSectionManager, cachingLevel): def __init__(self, metaInfo, superSectionManager, cachingLevel):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment