OctopusDeploy / Halibut

| Public | A secure communication stack for .NET using JSON-RPC over SSL.
Other
12 stars 44 forks source link

Fix handling of errors in async services. #524

Closed LukeButters closed 11 months ago

LukeButters commented 11 months ago

Background

Fixes an issue where the exception thrown by an async service would not be wrapped in a InvocationTargetException, resulting in the client being unable to determine that the exception occurred within the service itself.

The change is to wrap the exception thrown by the async service in a InvocationTargetException which means the halibut service invoker now always throws a InvocationTargetException for exceptions thrown in sync or async services.

An async service is one that looks like: (e.g. `class AsyncEchoService : IAsyncEchoService { public Task Foo() {await Task.Complete;}})

How to review this PR

Review the two commits separately, the first modifies the test infrastructure and the second adds the fix and tests.