Ruby - catch exceptions by const reference
This commit is contained in:
parent
c08e0d19f9
commit
4ce77ffb77
1 changed files with 8 additions and 9 deletions
|
|
@ -628,7 +628,7 @@ namespace swig
|
||||||
try {
|
try {
|
||||||
r = swig::from< const Sequence* >( swig::getslice(self, i, j) );
|
r = swig::from< const Sequence* >( swig::getslice(self, i, j) );
|
||||||
}
|
}
|
||||||
catch( std::out_of_range& ) {
|
catch( const std::out_of_range& ) {
|
||||||
}
|
}
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
@ -687,9 +687,8 @@ namespace swig
|
||||||
r = swig::from< Sequence::value_type >( *(at) );
|
r = swig::from< Sequence::value_type >( *(at) );
|
||||||
$self->erase(at);
|
$self->erase(at);
|
||||||
}
|
}
|
||||||
catch (std::out_of_range&)
|
catch (const std::out_of_range&) {
|
||||||
{
|
}
|
||||||
}
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -757,7 +756,7 @@ namespace swig
|
||||||
try {
|
try {
|
||||||
r = swig::from< Sequence::value_type >( *(swig::cgetpos(self, i)) );
|
r = swig::from< Sequence::value_type >( *(swig::cgetpos(self, i)) );
|
||||||
}
|
}
|
||||||
catch( std::out_of_range& ) {
|
catch( const std::out_of_range& ) {
|
||||||
}
|
}
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
@ -780,7 +779,7 @@ namespace swig
|
||||||
try {
|
try {
|
||||||
r = swig::from< const Sequence* >( swig::getslice(self, i, j) );
|
r = swig::from< const Sequence* >( swig::getslice(self, i, j) );
|
||||||
}
|
}
|
||||||
catch( std::out_of_range& ) {
|
catch( const std::out_of_range& ) {
|
||||||
}
|
}
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
@ -790,7 +789,7 @@ namespace swig
|
||||||
try {
|
try {
|
||||||
r = swig::from< Sequence::value_type >( *(swig::cgetpos(self, i)) );
|
r = swig::from< Sequence::value_type >( *(swig::cgetpos(self, i)) );
|
||||||
}
|
}
|
||||||
catch( std::out_of_range& ) {
|
catch( const std::out_of_range& ) {
|
||||||
}
|
}
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
@ -1017,7 +1016,7 @@ namespace swig {
|
||||||
} else {
|
} else {
|
||||||
return rubyseq.check() ? SWIG_OK : SWIG_ERROR;
|
return rubyseq.check() ? SWIG_OK : SWIG_ERROR;
|
||||||
}
|
}
|
||||||
} catch (std::exception& e) {
|
} catch (const std::exception& e) {
|
||||||
if (seq) {
|
if (seq) {
|
||||||
VALUE lastErr = rb_gv_get("$!");
|
VALUE lastErr = rb_gv_get("$!");
|
||||||
if (lastErr == Qnil) {
|
if (lastErr == Qnil) {
|
||||||
|
|
@ -1057,7 +1056,7 @@ namespace swig {
|
||||||
} else {
|
} else {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} catch (std::exception& e) {
|
} catch (const std::exception& e) {
|
||||||
if (seq) {
|
if (seq) {
|
||||||
VALUE lastErr = rb_gv_get("$!");
|
VALUE lastErr = rb_gv_get("$!");
|
||||||
if (lastErr == Qnil) {
|
if (lastErr == Qnil) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue