 |
Forums |
Admin Start New Thread
By: Kirk Haines
RE: Debugging [ reply ] 2004-08-27 21:32
|
|
Ah well. You are both very, very correct. :) I just emailed him to see if he has anything else percholating in his brain that he would share with me.
|
By: Daniel Berger
RE: Debugging [ reply ] 2004-08-27 21:26
|
"and he's right that the 'raise "foo"' statements in places are just....ugly."
Heh - actually that was my comment. Only the stuff in quotes is from David. The rest is me. :)
Regards,
Dan
|
By: Kirk Haines
RE: Debugging [ reply ] 2004-08-27 21:20
|
David has good points. I need to email him and have him send any other thoughts that he has on to me.
I mentioned this somehwere, but I'll be danged if I remember where, but things for 0.9.2 include, basically, a version of PrettyException that doesn't rely on that MW::Template class that doesn't work on Windows, along with a number of other debugging aids, including just some generally improved exceptions and exception handling. There are some places where exceptions are not handled gracefully where they should be, and he's right that the 'raise "foo"' statements in places are just....ugly. I have an excuse. Those went in when I was still very new to Ruby and didn't know better. :)
|
By: Daniel Berger
Debugging [ reply ] 2004-08-27 20:50
|
I thought you might be interested in this note from David Naseby's blog:
"Other than purity, another reason I’m not entirely content in Iowa-land is debugging. Every time I add a component, I feel pretty certain that I’ll screw some binding up, or miss something, and I’ll end up with a stacktrace in WEBrick with the dreaded ‘nil does not respond to…’ error, plus a bunch of useless info for the classes that did the eval-ing of the buggered component. I’ve learned now not to panic about it, but it would be nice if I could get some better info about what I’ve forgotten, and where."
Looking at iowa.rb, I see a lot of 'raise foo' type of statements (in Iowa.configuration, for example). I don't like this because it raises RuntimeError's, which I don't necessarily feel are appropriate. One of the things I (almost) always do when creating new modules is to create my own error classes. It's nicer for end users who may want to specifically look for module-specific errors. Without it, it's possible that some other RuntimeError could occur, and then you have to analye the error message to determine if it came from your package or somewhere else.
Is it possible you could integrate something like "PrettyException" and (optionally?) send errors to the browser instead of (only) the log file?
Just a thought.
Regards,
Dan
|
|
 |