diff options
author | Jose <jose@zeroc.com> | 2017-09-20 11:05:13 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2017-09-20 11:05:13 +0200 |
commit | 7f0816001e085f482f8f9a34b7f8e06435907510 (patch) | |
tree | 46807f18b840e1c9816cd9b4aac001c8078d8bce /cpp/src/Ice/ios/StreamTransceiver.cpp | |
parent | Fixed Ice/acm Java7 build failure (diff) | |
download | ice-7f0816001e085f482f8f9a34b7f8e06435907510.tar.bz2 ice-7f0816001e085f482f8f9a34b7f8e06435907510.tar.xz ice-7f0816001e085f482f8f9a34b7f8e06435907510.zip |
Clean C++ exception code to only throw exception types
- Update C++ code to only throw types derived from
C++ exception
- Update C++ code to use one-shot constructors to
create the exceptions
Fix bug ICE-7892
Diffstat (limited to 'cpp/src/Ice/ios/StreamTransceiver.cpp')
-rw-r--r-- | cpp/src/Ice/ios/StreamTransceiver.cpp | 31 |
1 files changed, 7 insertions, 24 deletions
diff --git a/cpp/src/Ice/ios/StreamTransceiver.cpp b/cpp/src/Ice/ios/StreamTransceiver.cpp index cc0624fee78..7eba9c5f83a 100644 --- a/cpp/src/Ice/ios/StreamTransceiver.cpp +++ b/cpp/src/Ice/ios/StreamTransceiver.cpp @@ -374,9 +374,7 @@ IceObjC::StreamTransceiver::read(Buffer& buf) if(ret == 0) { - ConnectionLostException ex(__FILE__, __LINE__); - ex.error = 0; - throw ex; + throw ConnectionLostException(__FILE__, __LINE__, 0); } if(ret == SOCKET_ERROR) @@ -521,27 +519,19 @@ IceObjC::StreamTransceiver::checkErrorStatus(CFWriteStreamRef writeStream, CFRea } else if(connectionLost()) { - ConnectionLostException ex(file, line); - ex.error = getSocketErrno(); - throw ex; + throw ConnectionLostException(file, line, getSocketErrno()); } else if(connectionRefused()) { - ConnectionRefusedException ex(file, line); - ex.error = getSocketErrno(); - throw ex; + throw ConnectionRefusedException(file, line, getSocketErrno()); } else if(connectFailed()) { - ConnectFailedException ex(file, line); - ex.error = getSocketErrno(); - throw ex; + throw ConnectFailedException(file, line, getSocketErrno()); } else { - SocketException ex(file, line); - ex.error = getSocketErrno(); - throw ex; + throw SocketException(file, line, getSocketErrno()); } } @@ -558,14 +548,7 @@ IceObjC::StreamTransceiver::checkErrorStatus(CFWriteStreamRef writeStream, CFRea CFNumberGetValue(d, kCFNumberSInt32Type, &rs); } } - DNSException ex(file, line); - ex.error = rs; - ex.host = _host; - throw ex; + throw DNSException(file, line, rs, _host); } - - CFNetworkException ex(file, line); - ex.domain = fromCFString(domain); - ex.error = CFErrorGetCode(err.get()); - throw ex; + throw CFNetworkException(file, line, CFErrorGetCode(err.get()), domain); } |