# Can I intercept "instance variable XYZ not initialized"

**URL:** <https://www.ruby-forum.com/t/can-i-intercept-instance-variable-xyz-not-initialized/111192>\
**Category:** Ruby\
**Created:** [August 3, 2007, 6:36pm UTC](https://www.ruby-forum.com/t/can-i-intercept-instance-variable-xyz-not-initialized/111192 "2007-08-03T18:36:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lfast](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ee59a6/32.png) [@lfast](https://www.ruby-forum.com/u/lfast)\
**Post date:** [August 3, 2007, 6:36pm UTC](https://www.ruby-forum.com/t/can-i-intercept-instance-variable-xyz-not-initialized/111192/1 "2007-08-03T18:36:03Z")

</div>

I’m working with Test::Unit and want to reduce the amount of noise in  
the results. One annoying problem with negative test cases is “warning:  
instance variable XYZ not initialized”

I may simply be doing things wrong but it seems that throw-catch and  
begin-rescue aren’t capable of ‘catching’ this message.

I’d rather avoid post-processing the output. First because it decouples  
and duplicates the references. Secondly because I don’t want to mask  
legitimate errors.

Suggestions?  
Larry
