public BaiduYunSmsClient(BaiduYunConfig config, Action <Exception> exceptionHandler = null) { _config = config ?? throw new ArgumentNullException(nameof(config)); _account = _config.Account ?? throw new ArgumentNullException(nameof(_config.Account)); _apiServerUrl = $"{GetHttpPrefix(config)}://{GetApiServerUrl(config)}"; _proxy = HttpApiClient.Create <IBaiduYunSmsApis>(_apiServerUrl); var globalHandle = ExceptionHandleResolver.ResolveHandler(); globalHandle += exceptionHandler; _exceptionHandler = globalHandle; }
public BaiduYunSmsClient(BaiduYunConfig config, Action <Exception> exceptionHandler = null) { _config = config ?? throw new ArgumentNullException(nameof(config)); _account = _config.Account ?? throw new ArgumentNullException(nameof(_config.Account)); _apiServerUrl = ApiAddressHelper.Get(config); _proxy = WebApiClientCreator.Create(_apiServerUrl, _config.TimeOut); var globalHandle = ExceptionHandleResolver.ResolveHandler(); globalHandle += exceptionHandler; _exceptionHandler = globalHandle; }