filsystem.py: Add more information to exceptions
Change-Id: Ia9449ddfaaf5f49e0a65aeeea9435141fd55fe65
diff --git a/pySim/filesystem.py b/pySim/filesystem.py
index 2023495..1068930 100644
--- a/pySim/filesystem.py
+++ b/pySim/filesystem.py
@@ -209,13 +209,13 @@
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