CFNetworkHandler is not a valid http message handler for watchOS, so show a helpful message if someone tries. (#879)

This commit is contained in:
Rolf Bjarne Kvinge 2016-09-22 18:08:16 +02:00 коммит произвёл GitHub
Родитель 351bb29f0c
Коммит 88a9b809d2
3 изменённых файлов: 7 добавлений и 5 удалений

Просмотреть файл

@ -837,7 +837,7 @@ This generally indicates that there is a problem with your Xamarin.iOS installat
<!--- 2012 used by mmp --> <!--- 2012 used by mmp -->
<h3><a name="MT2015"/>MT2015: Invalid HttpMessageHandler `*` for watchOS. Valid values are NSUrlSessionHandler (default) or CFNetworkHandler</h3> <h3><a name="MT2015"/>MT2015: Invalid HttpMessageHandler `*` for watchOS. The only valid value is NSUrlSessionHandler.</h3>
<!-- <!--
MT3xxx AOT MT3xxx AOT

Просмотреть файл

@ -66,11 +66,11 @@ namespace XamCore.ObjCRuntime {
// default // default
case null: case null:
return HttpClientHandlerValue; return HttpClientHandlerValue;
case CFNetworkHandlerValue:
case HttpClientHandlerValue: case HttpClientHandlerValue:
if (Driver.App.Platform == Utils.ApplePlatform.WatchOS) if (Driver.App.Platform == Utils.ApplePlatform.WatchOS)
throw ErrorHelper.CreateError (2015, "Invalid HttpMessageHandler `{0}` for watchOS. Valid values are NSUrlSessionHandler (default) or CFNetworkHandler", value); throw ErrorHelper.CreateError (2015, "Invalid HttpMessageHandler `{0}` for watchOS. The only valid value is NSUrlSessionHandler.", value);
return value; return value;
case CFNetworkHandlerValue:
case NSUrlSessionHandlerValue: case NSUrlSessionHandlerValue:
return value; return value;
default: default:
@ -186,10 +186,12 @@ namespace XamCore.ObjCRuntime {
#else #else
case HttpClientHandlerValue: case HttpClientHandlerValue:
if (Driver.App.Platform == Utils.ApplePlatform.WatchOS) if (Driver.App.Platform == Utils.ApplePlatform.WatchOS)
throw ErrorHelper.CreateError (2015, "Invalid HttpMessageHandler `{0}` for watchOS. Valid values are NSUrlSessionHandler (default) or CFNetworkHandler", handler); throw ErrorHelper.CreateError (2015, "Invalid HttpMessageHandler `{0}` for watchOS. The only valid value is NSUrlSessionHandler.", handler);
type = httpModule.GetType ("System.Net.Http", "HttpClientHandler"); type = httpModule.GetType ("System.Net.Http", "HttpClientHandler");
break; break;
case CFNetworkHandlerValue: case CFNetworkHandlerValue:
if (Driver.App.Platform == Utils.ApplePlatform.WatchOS)
throw ErrorHelper.CreateError (2015, "Invalid HttpMessageHandler `{0}` for watchOS. The only valid value is NSUrlSessionHandler.", handler);
type = httpModule.GetType ("System.Net.Http", "CFNetworkHandler"); type = httpModule.GetType ("System.Net.Http", "CFNetworkHandler");
break; break;
case NSUrlSessionHandlerValue: case NSUrlSessionHandlerValue:

Просмотреть файл

@ -204,7 +204,7 @@ namespace Xamarin.Bundler {
// MT2012 ** reserved Xamarin.Mac ** // MT2012 ** reserved Xamarin.Mac **
// MT2013 ** reserved Xamarin.Mac ** // MT2013 ** reserved Xamarin.Mac **
// MT2014 ** reserved Xamarin.Mac ** // MT2014 ** reserved Xamarin.Mac **
// MT2015 Invalid HttpMessageHandler `{0}` for watchOS. Valid values are NSUrlSessionHandler (default) or CFNetworkHandler // MT2015 Invalid HttpMessageHandler `{0}` for watchOS. The only valid value is NSUrlSessionHandler.
// MT3xxx AOT // MT3xxx AOT
// MT30xx AOT (general) errors // MT30xx AOT (general) errors
// MT3001 Could not AOT the assembly '{0}' // MT3001 Could not AOT the assembly '{0}'