Explorar el Código

Ensure that errors in client calls are always provided to the user.

The expected behavior is now for the client call's completion handler to be called when the whole call is completed. You can check that completion handler's `statusCode` for the call's result. The intermediate send/receive call completion handlers will also get called with an error, but that error's status code is most likely to be `.unknown` (because send/receive calls don't receive the final status from the server).
In addition, `CallResult` now also includes the operation group's success flag, but that flag is much less important now.

This includes:
- Make most completion handlers non-throwing (their errors were for the most part discarded, anyway)
- Extract Receive-Streaming into a common protocol
- Changing many completion handler interfaces to be called with a `CallResult` instead of `Data?` and `ResultOrRPCError<ReceivedType?>` instead of `(ReceivedType, Error)`
- Not throwing on end of stream, but passing `nil` to the completion handler instead
- Making `ServerSessionUnary` always return an error when one of its calls fail
- Adding test to ensure the proper error behavior.
Daniel Alm hace 7 años
padre
commit
ba838f931c
Se han modificado 1 ficheros con 6 adiciones y 11 borrados
  1. 6 11
      .gitignore

+ 6 - 11
.gitignore

@@ -2,16 +2,11 @@
 project.xcworkspace
 xcuserdata
 .build
-protoc-gen-swift
-protoc-gen-swiftgrpc
+/protoc-gen-swift
+/protoc-gen-swiftgrpc
 third_party/**
-Plugin/Packages/**
-Plugin/Sources/protoc-gen-swiftgrpc/templates.swift
-Plugin/protoc-*
-Plugin/swiftgrpc.log
-Plugin/echo.*.swift
-Echo
-test.out
-echo.pid
-SwiftGRPC.xcodeproj
+/Echo
+/test.out
+/echo.pid
+/SwiftGRPC.xcodeproj
 Package.resolved