summaryrefslogtreecommitdiff
path: root/rb/src/IceRuby/Proxy.cpp
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2014-08-19 13:10:29 -0230
committerDwayne Boone <dwayne@zeroc.com>2014-08-19 13:10:29 -0230
commitc6d20e1e1afc75f8bd889c093ccbffb247ec30cb (patch)
tree19443a7e7263ce1d715dad261b4574942c419552 /rb/src/IceRuby/Proxy.cpp
parentFixed (ICE-5592) - Add IceSSL.FindCert for OS X and Windows (diff)
downloadice-c6d20e1e1afc75f8bd889c093ccbffb247ec30cb.tar.bz2
ice-c6d20e1e1afc75f8bd889c093ccbffb247ec30cb.tar.xz
ice-c6d20e1e1afc75f8bd889c093ccbffb247ec30cb.zip
ICE-3492 handle improper settings for timeout values
Diffstat (limited to 'rb/src/IceRuby/Proxy.cpp')
-rw-r--r--rb/src/IceRuby/Proxy.cpp39
1 files changed, 30 insertions, 9 deletions
diff --git a/rb/src/IceRuby/Proxy.cpp b/rb/src/IceRuby/Proxy.cpp
index e239414f1f8..686b4b10f42 100644
--- a/rb/src/IceRuby/Proxy.cpp
+++ b/rb/src/IceRuby/Proxy.cpp
@@ -446,9 +446,16 @@ IceRuby_ObjectPrx_ice_locatorCacheTimeout(VALUE self, VALUE timeout)
{
ICE_RUBY_TRY
{
- Ice::ObjectPrx p = getProxy(self);
- long t = getInteger(timeout);
- return createProxy(p->ice_locatorCacheTimeout(static_cast<Ice::Int>(t)), rb_class_of(self));
+ try
+ {
+ Ice::ObjectPrx p = getProxy(self);
+ long t = getInteger(timeout);
+ return createProxy(p->ice_locatorCacheTimeout(static_cast<Ice::Int>(t)), rb_class_of(self));
+ }
+ catch(const IceUtil::IllegalArgumentException& ex)
+ {
+ throw RubyException(rb_eArgError, ex.reason().c_str());
+ }
}
ICE_RUBY_CATCH
return Qnil;
@@ -460,9 +467,16 @@ IceRuby_ObjectPrx_ice_invocationTimeout(VALUE self, VALUE timeout)
{
ICE_RUBY_TRY
{
- Ice::ObjectPrx p = getProxy(self);
- long t = getInteger(timeout);
- return createProxy(p->ice_invocationTimeout(static_cast<Ice::Int>(t)), rb_class_of(self));
+ try
+ {
+ Ice::ObjectPrx p = getProxy(self);
+ long t = getInteger(timeout);
+ return createProxy(p->ice_invocationTimeout(static_cast<Ice::Int>(t)), rb_class_of(self));
+ }
+ catch(const IceUtil::IllegalArgumentException& ex)
+ {
+ throw RubyException(rb_eArgError, ex.reason().c_str());
+ }
}
ICE_RUBY_CATCH
return Qnil;
@@ -852,9 +866,16 @@ IceRuby_ObjectPrx_ice_timeout(VALUE self, VALUE t)
{
ICE_RUBY_TRY
{
- Ice::ObjectPrx p = getProxy(self);
- Ice::Int timeout = static_cast<Ice::Int>(getInteger(t));
- return createProxy(p->ice_timeout(timeout), rb_class_of(self));
+ try
+ {
+ Ice::ObjectPrx p = getProxy(self);
+ Ice::Int timeout = static_cast<Ice::Int>(getInteger(t));
+ return createProxy(p->ice_timeout(timeout), rb_class_of(self));
+ }
+ catch(const IceUtil::IllegalArgumentException& ex)
+ {
+ throw RubyException(rb_eArgError, ex.reason().c_str());
+ }
}
ICE_RUBY_CATCH
return Qnil;