diff options
author | Benoit Foucher <benoit@zeroc.com> | 2005-06-22 19:23:31 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2005-06-22 19:23:31 +0000 |
commit | 5adb343e65d4c064152d87ecec014bbec84042d4 (patch) | |
tree | 75c809d59ec4874e519cd338714bc5627682edce /cpp/src | |
parent | Added session tests, completed update tests. (diff) | |
download | ice-5adb343e65d4c064152d87ecec014bbec84042d4.tar.bz2 ice-5adb343e65d4c064152d87ecec014bbec84042d4.tar.xz ice-5adb343e65d4c064152d87ecec014bbec84042d4.zip |
Added FileException
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Ice/Exception.cpp | 11 | ||||
-rw-r--r-- | cpp/src/Ice/Instance.cpp | 6 | ||||
-rw-r--r-- | cpp/src/Ice/PropertiesI.cpp | 3 |
3 files changed, 17 insertions, 3 deletions
diff --git a/cpp/src/Ice/Exception.cpp b/cpp/src/Ice/Exception.cpp index 97e674f6952..52e531a8cd1 100644 --- a/cpp/src/Ice/Exception.cpp +++ b/cpp/src/Ice/Exception.cpp @@ -194,6 +194,17 @@ Ice::SocketException::ice_print(ostream& out) const } void +Ice::FileException::ice_print(ostream& out) const +{ + Exception::ice_print(out); + out << ":\nfile exception: " << errorToString(error); + if(!path.empty()) + { + out << "\npath: " << path; + } +} + +void Ice::ConnectFailedException::ice_print(ostream& out) const { Exception::ice_print(out); diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp index 3b9403d825e..73c99c93176 100644 --- a/cpp/src/Ice/Instance.cpp +++ b/cpp/src/Ice/Instance.cpp @@ -420,7 +420,8 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Prope FILE* file = freopen(stdOutFilename.c_str(), "a", stdout); if(file == 0) { - SyscallException ex(__FILE__, __LINE__); + FileException ex(__FILE__, __LINE__); + ex.path = stdOutFilename; ex.error = getSystemErrno(); throw ex; } @@ -431,7 +432,8 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Prope FILE* file = freopen(stdErrFilename.c_str(), "a", stderr); if(file == 0) { - SyscallException ex(__FILE__, __LINE__); + FileException ex(__FILE__, __LINE__); + ex.path = stdErrFilename; ex.error = getSystemErrno(); throw ex; } diff --git a/cpp/src/Ice/PropertiesI.cpp b/cpp/src/Ice/PropertiesI.cpp index 91b5963f9ee..fc3f9a7fd0c 100644 --- a/cpp/src/Ice/PropertiesI.cpp +++ b/cpp/src/Ice/PropertiesI.cpp @@ -222,7 +222,8 @@ Ice::PropertiesI::load(const std::string& file) ifstream in(file.c_str()); if(!in) { - SyscallException ex(__FILE__, __LINE__); + FileException ex(__FILE__, __LINE__); + ex.path = file; ex.error = getSystemErrno(); throw ex; } |