Menu

#41 Handling exceptions thrown by typemap conversions

None
wont-fix
nobody
None
5
2022-03-16
2006-11-07
No

This is a feature request.

Exceptions thrown by the C++ function call itself are
handled by the %exception framework. However,
conversion exceptions from in, out, argout, memberin,
memberout, varin, varout ... typemaps are not caught
by %exception block. While it is possible to handle
each typemap by an individual try/catch block, it
would be nice if there were a similar mechanism, or
if %exception covered conversions as well.

Discussion

  • Olly Betts

    Olly Betts - 2022-03-16
    • status: open --> wont-fix
    • Group: -->
     
  • Olly Betts

    Olly Betts - 2022-03-16

    It seems to me better to just handle the exception in any typemaps which might generate it - that avoids unnecessary overhead from exception handling blocks in places that can't throw exceptions and also means the exception handling can often be made more specific as there's more knowledge of what the cause might be.

    Given nobody else has implemented this or even commented on it in 15+ years, I'm going to reject the suggestion. Sorry.

     

Log in to post a comment.

MongoDB Logo MongoDB