Giving Sofud better error messages
Posted by randomz on April 28, 2007
I’m currently looking for a way to print the “path” of the relevant Sofu object with every Sofud error message. However, this is not quite as simple, because the hierarchy can be edited in memory, so I can’t simply create the paths at load time.
So I need a way to create those paths at any time. Since I save a map’s attributes inside an associative array, this means I have to do a linear search (yuck) over its keys. The same in the case of a list: it’s not sorted, so I can’t use any kind of smart search algorithms.
Still, this situation should mostly only occur in error situations, so it’s okay if it’s inefficient.