arkane-systems / Arkane.Zeroconf

A Zero Configuration Networking library for .NET.
Other
3 stars 5 forks source link

propogate exceptions to caller #6

Open d79ima opened 4 years ago

d79ima commented 4 years ago

I noticed occasionally call to ServiceBrowser.Browse would result in exception being silently thrown, which i only noticed on the debugger in Visual Studio: Exception thrown: 'ArkaneSystems.Arkane.Zeroconf.Providers.Bonjour.ServiceErrorException' in Arkane.Zeroconf.dll

Exception is being silently dropped in Providers/Bonjour/ServiceBrowser.cs Start(async = true) method. Because of this.task = Task.Run (() => this.ProcessStart ()).ContinueWith (_ => this.task = null) ; Task.Run just drops any exceptions thrown by ProcessStart().

Could you please provide a public API that is friendly with async/await that exposes Task as a return value so caller can decide how best to handle exceptions on async calls. Or at a minimum provide an option to use Synchronous Browse and let caller handle async routing on their own

cerebrate commented 4 years ago

Exception is now propagated upwards, per first version of this issue. Considering further updates.