#994 PreviousDeleted exception has totally wrong message

open
Klaus Kämpf
ruby (61)
5
2012-12-10
2009-02-11
Tobias Grimm
No

SWIG_Ruby_ConvertPtrAndOwn may return a SWIG_ObjectPreviouslyDeletedError.

In a method wrapper, such error results are catched like this:

res1 = SWIG_ConvertPtr(self,
&argp1,SWIGTYPE_p_Foo, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1),
Ruby_Format_TypeError( "", "Foo *","DoSomething", 1,
self ));
}

This way the ObjectPreviouslyDeletedError gets a TypeError message which is totally wrong and misleading.

Previous versions of SWIG have thrown an exception with a message like "This Animal * already released" (see ruby documentation.

I think the last working version was 1.3.27. See:

http://swig.svn.sourceforge.net/viewvc/swig/tags/rel-1-3-27/SWIG/Lib/ruby/rubydef.swg?revision=7668&view=markup

Tobias

Discussion

  • William Fulton
    William Fulton
    2012-12-10

    • assigned_to: gga73 --> kkaempf