private static async void helloAsync(HelloPrx hello) { try { await hello.sayHelloAsync(5000); } catch (RequestCanceledException) { Console.Error.WriteLine("RequestCanceledException"); } catch (Exception ex) { Console.Error.WriteLine("sayHello AMI call failed:"); Console.Error.WriteLine(ex); } }
private async void helloAsync(HelloPrx hello) { try { await hello.sayHelloAsync(5000); } catch(AggregateException ae) { if(ae.InnerException is RequestCanceledException) { Console.Error.WriteLine("RequestCanceledException"); } else { Console.Error.WriteLine("sayHello AMI call failed:"); Console.Error.WriteLine(ae.InnerException); } } }
private async void helloAsync(HelloPrx hello) { try { await hello.sayHelloAsync(5000); } catch (AggregateException ae) { if (ae.InnerException is RequestCanceledException) { Console.Error.WriteLine("RequestCanceledException"); } else { Console.Error.WriteLine("sayHello AMI call failed:"); Console.Error.WriteLine(ae.InnerException); } } }