Sebastian\’s Coding Blog

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.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: