X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Socket%2FSocketHandle.cti;fp=Socket%2FSocketHandle.cti;h=39b32734aa07196df15eee2ac2306b701a58ed0e;hb=d2459b6c8249291588fd3d0d125ed3d38e003b55;hp=456a7b15c729ad5bf87a006fb606c08df334ec85;hpb=8ec0b7ed2df36144b52df5aa40497fc5409c31f7;p=senf.git diff --git a/Socket/SocketHandle.cti b/Socket/SocketHandle.cti index 456a7b1..39b3273 100644 --- a/Socket/SocketHandle.cti +++ b/Socket/SocketHandle.cti @@ -113,7 +113,7 @@ senf::SocketHandle::cast_dynamic(FileHandle handle) { // throws bad_cast if the body is not a SocketBody SocketBody & body (dynamic_cast(FileHandle::body(handle))); - // throws bad_cast if the policy is not compatible + // throws bad_cast if the policy is not compatible (already wrapped ...) SPolicy::checkBaseOf(body.protocol().policy()); return cast_static(handle); } @@ -138,7 +138,10 @@ prefix_ Target senf::dynamic_socket_cast(Source handle) boost::is_convertible::value && ( boost::is_convertible::value || boost::is_convertible::value ) )); - return Target::cast_dynamic(handle); + try { + return Target::cast_dynamic(handle); + } + SENF_WRAP_EXC(std::bad_cast) } template