influxdb-client-csharp icon indicating copy to clipboard operation
influxdb-client-csharp copied to clipboard

writeApi: extend example in README with EventHandler usage

Open TanyaTarasovaTT opened this issue 3 years ago • 1 comments

It was totally not clear where to look for errors. I've seen a lot of questions in internet asking the same thing. Having EventHandler in README will give this understanding right away. writeApi.EventHandler += (sender, eventArgs) => { if ( e is WriteErrorEvent @ev1 ) { throw new Exception( @ev1.Exception.Message ); } if ( e is WriteRuntimeExceptionEvent @ev2 ) { throw new Exception( ev2.Exception.Message ); } };

TanyaTarasovaTT avatar Jun 24 '21 13:06 TanyaTarasovaTT

Hi @TatianaInfoGuild,

thanks for using our client. We will take a look.

Regards

bednar avatar Jun 25 '21 06:06 bednar

For more info about usage of EventHandler see:

  • https://github.com/influxdata/influxdb-client-csharp/tree/master/Client#handle-the-events
  • https://github.com/influxdata/influxdb-client-csharp/blob/master/Examples/WriteEventHandlerExample.cs

bednar avatar Sep 07 '22 08:09 bednar