filsystem.py: Add more information to exceptions

Change-Id: Ia9449ddfaaf5f49e0a65aeeea9435141fd55fe65
This commit is contained in:
Harald Welte 2021-04-21 11:01:26 +02:00
parent 8fe1d202c7
commit 977035c429
1 changed files with 3 additions and 3 deletions

View File

@ -209,13 +209,13 @@ class CardDF(CardFile):
if child.fid in self.children:
if ignore_existing:
return
raise ValueError("File with given fid %s already exists" % (child.fid))
raise ValueError("File with given fid %s already exists in %s" % (child.fid, self))
if self.lookup_file_by_sfid(child.sfid):
raise ValueError("File with given sfid %s already exists" % (child.sfid))
raise ValueError("File with given sfid %s already exists in %s" % (child.sfid, self))
if self.lookup_file_by_name(child.name):
if ignore_existing:
return
raise ValueError("File with given name %s already exists" % (child.name))
raise ValueError("File with given name %s already exists in %s" % (child.name, self))
self.children[child.fid] = child
child.parent = self