[Ironruby-core] Code Review: Better error messages

Shri Borde Shri.Borde at microsoft.com
Fri Jan 23 17:04:04 EST 2009

  tfpt review "/shelveset:error;REDMOND\sborde"


  Change in DefaultBinder is to make the binder exception processing logic be extensible so that languages can customize the type of exception thrown.


  Improves error reporting in IronRuby by checking the results of the bind failure. This allowed many Math tests to be enabled.

  Also, added a DefaultProtocol for to_f. This allowed more Math tests to be enabled as you can now pass the string "1.0" to a function expecting a "Float". I have added test cases for the Float conversion rules in core\math\acos_spec.rb. I have not copied this to the other specs as that would be hard to maintain. We will look at factoring such conversion checks into a utility library so that they will be much easier to use.

  Fixes some String bugs - String.#inspect on string subtype should return a string, and passing wrong argument types to Strings#[]= should cause TypeError instead of ArgumentError. This is where I started and it put me in the direction of the fixes above.

  Tomas: In RubyBinder.GetTypeName, is there a better way to get to RubyContext?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: error.diff
Type: application/octet-stream
Size: 76269 bytes
Desc: error.diff
URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20090123/fa79af49/attachment-0001.obj>

More information about the Ironruby-core mailing list