Commit Graph

7 Commits

Author SHA1 Message Date
Ryan Nowak b00c02f320
Throw DaprException for errors in DaprClient (#561)
* Unify DaprException classes

We have two classes called DaprException.

It makes way more sense for us to have DaprException in the Dapr.Client
project, and it also makes sense for Dapr.Actors to reference
Dapr.Client (it did not for some reason).

There's some additional cleanup of code related to
JsonSerializerOptions. The Actors code was not referencing the 5.0.0
version of the package, and so it's now got access to some new stuff,
so we could remove a polyfill.

* Throw DaprException for errors

Fixes: #516

This updates all of the locations in DaprClient that handle networking
or serialization to throw DaprException instead of the underlying
exception type. This allows for simpler error handling.

* Add one more unit test
2021-01-26 20:05:17 -08:00
Carlos Mendible 1a51570aa6
DaprClient: Implementing GetBulkSecretAsync (#511) 2021-01-21 15:35:24 -08:00
Ryan Nowak 776156298e
Apply linting suggestions (#492)
We've had a list of linting-related messages piling up for a while now.
This change bulk-applies these suggestions with usually relate to
simplification or use or newer language features like ??=

The only changes I did manually here are:

    Removing some usage of Task.GetAwaiter().GetResult() where it was
    just laziness
    Removing some dead code in methods and parameters of internal APIs.
2021-01-04 17:35:57 -08:00
vinayada1 80f2319fe4
Handle rpc exception thrown for operation cancellation (#455)
* Handle cancelled cancellation token

* add UTs

* add secrets UT

* fix review comments

* invoke and await in one call

* fix await

* Add test for multiple calls to UseActors (#459)

Fixes: #411

The bug was actually addressed in PR #453 - this change adds a test that
verifies that we actually fixed it.

Co-authored-by: vinayada1 <28875764+vinayada1@users.noreply.github.com>

* use grpcChannelOptions ThrowOperationCanceledOnCancellation

* Add doc

* add link to doc

Co-authored-by: Ryan Nowak <nowakra@gmail.com>
2020-11-19 11:22:33 -08:00
Sander Molenkamp f3b5c7db81
Update client to latest proto files (#315)
* Update client to latest proto files

* Update PublishEventApiTest.cs

Merge conflict.

Co-authored-by: Leon Mai <lemai@microsoft.com>
2020-05-29 10:35:53 -07:00
Leon Mai 44ca6496d8
Move to new invoke proto, specify contenttype in response to the dapr… (#295)
* Move to new invoke proto, specify contenttype in response to the dapr/config message, clarify sample

* Update for additional proto changes

* cr

Co-authored-by: LM <lemai>
2020-04-30 11:47:29 -07:00
Aman Bhardwaj 51fc48fb74
Adding & enhancing client apis over gRPC (#244)
* adding IDAprClient interface

* Adding DaprClientBuilder and adding methods for Publish

* updating the method name for publish

* Adding unit tests for publishevent api

* Removing individual clients for publish

* Renaming base class to DaprClient and implementation calss to DparClientGrpc

* Moving State api to grpc and adding helpers to unittest grpc calls.

* More DaprClient logic

* metadata, etag, options, etc are optional

* Revert "metadata, etag, options, etc are optional"

This reverts commit ea5dc12c5d.

* Default params, 2 new Try- methods, overload refactor for InvokeMethodAsync

* Move some classes/enums to different files.  Documentation

* Code refactor and changing tests to use grpc

* Adding tests with state options

* Adding test for getting etag and state

* More refactoring and adding INvokeBinding test

* Fixing tests and tidying up things.

* Updating solutions for renamed project

* Updating projects for rename.

* Oneclient secret (#245)

* ADding Secret Apis

* Using Task for secret

* Format (#242)

* Updating samples.slm

* awaint the call to grpc in common method so that common error handling can be done there.

* Addressing review comments

* fixing test.sln

* updating prod.sln

* Addressing review comments from James.

* Add doc and example for method invocation on http app

* Updating arg validation.

* Updating example.

Co-authored-by: LM <lemai>
Co-authored-by: Carlos Mendible <cmendible@gmail.com>
2020-03-09 20:52:12 -07:00