diff options
author | Reece Humphreys <reecewh@icloud.com> | 2019-07-18 11:22:59 -0400 |
---|---|---|
committer | Jose <pepone@users.noreply.github.com> | 2019-07-18 17:22:59 +0200 |
commit | b804b8d141c0f4243e9b27d02cdee184da2ee628 (patch) | |
tree | 073729c29aaaed080b3caa5f987927c3b0c4d295 /cpp/src/slice2swift/Gen.cpp | |
parent | Add support for forward declarations (diff) | |
download | ice-b804b8d141c0f4243e9b27d02cdee184da2ee628.tar.bz2 ice-b804b8d141c0f4243e9b27d02cdee184da2ee628.tar.xz ice-b804b8d141c0f4243e9b27d02cdee184da2ee628.zip |
Dispatch fixes for #421 (#440)
* Dispatch fixes for #421
* Add interceptor test
* Updated test to add test interceptor exceptions
* Dispatch fixes and add ability to retry
* Fixed comments
Diffstat (limited to 'cpp/src/slice2swift/Gen.cpp')
-rw-r--r-- | cpp/src/slice2swift/Gen.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/cpp/src/slice2swift/Gen.cpp b/cpp/src/slice2swift/Gen.cpp index 2215503dea9..1d8ff20d595 100644 --- a/cpp/src/slice2swift/Gen.cpp +++ b/cpp/src/slice2swift/Gen.cpp @@ -1593,9 +1593,11 @@ Gen::ObjectVisitor::visitClassDefStart(const ClassDefPtr& p) out << ("request: " + getUnqualified("Ice.Request", swiftModule)); out << ("current: " + getUnqualified("Ice.Current", swiftModule)); out << epar; - out << " throws"; + out << " throws -> PromiseKit.Promise<" << getUnqualified("Ice.OutputStream", swiftModule) << ">?"; out << sb; + // Call startOver() so that dispatch interceptors can retry requests + out << nl << "request.startOver()"; out << nl << "switch current.operation"; out << sb; out.dec(); // to align case with switch @@ -1606,12 +1608,12 @@ Gen::ObjectVisitor::visitClassDefStart(const ClassDefPtr& p) out.inc(); if(opName == "ice_id" || opName == "ice_ids" || opName == "ice_isA" || opName == "ice_ping") { - out << nl << "try (servant as? Object ?? " << disp << ".defaultObject)._iceD_" + out << nl << "return try (servant as? Object ?? " << disp << ".defaultObject)._iceD_" << opName << "(incoming: request, current: current)"; } else { - out << nl << "try servant._iceD_" << opName << "(incoming: request, current: current)"; + out << nl << "return try servant._iceD_" << opName << "(incoming: request, current: current)"; } out.dec(); } |