Should methods that return Task throw exceptions?
问题 The methods that return Task have two options for reporting an error: throwing exception right away returning the task that will finish with exception Should the caller expect both types of error reporting or is there some standard/agreement that limits task behavior to the second option? Example: class PageChecker { Task CheckWebPage(string url) { if(url == null) // Argument check throw Exception("Bad URL"); if(!HostPinger.IsHostOnline(url)) // Some other synchronous check throw Exception(