Skip to content

Commit

Permalink
fix(utils): just use console.error when miss required params
Browse files Browse the repository at this point in the history
  • Loading branch information
BuptStEve committed Jul 4, 2019
1 parent bb61792 commit 13624ab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tua-api",
"version": "1.3.1",
"version": "1.3.2",
"description": "🏗 A common tool helps converting configs to api functions",
"main": "dist/TuaApi.cjs.js",
"module": "dist/TuaApi.esm.js",
Expand Down
7 changes: 6 additions & 1 deletion src/utils/params.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,12 @@ const getDefaultParamObj = ({
args[key] == null

if (isRequiredValUndefined) {
throw Error(ERROR_STRINGS.requiredParamFn(apiName, key))
logger.error(ERROR_STRINGS.requiredParamFn(apiName, key))

/* istanbul ignore next */
if (process.env.NODE_ENV === 'test') {
throw TypeError(ERROR_STRINGS.requiredParamFn(apiName, key))
}
}

return { [key]: val }
Expand Down

0 comments on commit 13624ab

Please sign in to comment.