30 ms·
When using method_missing in a proxy why bother checking? Just call the method and let wrapped object handle the errors. The stack trace will show you where to
by epochwolf 16y ago
When using method_missing in a proxy why bother checking? Just call the method and let wrapped object handle the errors. The stack trace will show you where to look for the error. The only reason I can see to check before calling is if you have different failure mode than the wrapped object. Otherwise you are duplicating logic.
- jhickner 16y agoIt's a small thing, I admit, but I like getting a slightly cleaner stack trace since the exception happens in the wrapper module (where the error is) instead of getting all the way to @desk.
- epochwolf 16y agoAfter I've spent the last 2~3 years reading funky rails stacktraces something like that doesn't bother me a bit. (I get more worried about older versions of jruby deciding to puke on internal ruby<->java mismatches at work) :)