From 314b33888585988ec5040ac4b601b9de8b080d47 Mon Sep 17 00:00:00 2001 From: Lighting-Jack <574637316@qq.com> Date: Mon, 23 Sep 2019 20:33:10 +0800 Subject: [PATCH] feat(init): change throw error to warning when init without secretId/secretKey change throw error to warning when init without secretId/secretKey BREAKING CHANGE: change throw error to warning when init without secretId/secretKey --- dist/index.js | 2 +- src/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 8c3e48fd..3fd3dcb6 100644 --- a/dist/index.js +++ b/dist/index.js @@ -17,7 +17,7 @@ class SDK { }; const __config = _.omitBy(_.merge({}, defaultConfig, config), _.isUndefined); if (!__config.secretId || !__config.secretKey) - throw Error(error_1.ERR_MISSING_SECRET); + return console.warn(error_1.ERR_MISSING_SECRET); this.config = __config; const capi = new Capi({ SecretId: __config.secretId, diff --git a/src/index.ts b/src/index.ts index 4bc99409..f9cf1abc 100644 --- a/src/index.ts +++ b/src/index.ts @@ -18,7 +18,7 @@ class SDK { } const __config = _.omitBy(_.merge({}, defaultConfig, config), _.isUndefined) if (!__config.secretId || !__config.secretKey) - throw Error(ERR_MISSING_SECRET) + return console.warn(ERR_MISSING_SECRET) this.config = __config const capi = new Capi({