public AliyunDysmsClient(AliyunDysmsConfig config, Action <Exception> exceptionHandler = null) { _config = config ?? throw new ArgumentNullException(nameof(config)); _aliyunDysmsAccount = config.Account ?? throw new ArgumentNullException(nameof(config.Account)); _proxy = WebApiClientCreator.Create(config); var globalHandle = ExceptionHandleResolver.ResolveHandler(); globalHandle += exceptionHandler; _exceptionHandler = globalHandle; }
public AliyunDysmsClient(AliyunDysmsConfig config, Action <Exception> exceptionHandler = null) { _config = config ?? throw new ArgumentNullException(nameof(config)); _aliyunDysmsAccount = config.Account ?? throw new ArgumentNullException(nameof(config.Account)); _proxy = config.Security ? HttpApiClient.Create <IAliyunDysmsApi>("https://dysmsapi.aliyuncs.com") : HttpApiClient.Create <IAliyunDysmsApi>("http://dysmsapi.aliyuncs.com"); var globalHandle = ExceptionHandleResolver.ResolveHandler(); globalHandle += exceptionHandler; _exceptionHandler = globalHandle; }