diff --git a/index.js b/index.js index 8251471..a56a99c 100644 --- a/index.js +++ b/index.js @@ -322,7 +322,9 @@ */ function argJSONEncode(args) { each(args, function (arg, i) { - args[i] = JSON.stringify(arg); + if (typeof arg === 'object') { + args[i] = JSON.stringify(arg); + } }); return args; @@ -993,6 +995,10 @@ processName = processName.slice(0, dotIndex); } + if (!processorCreators[processName] || typeof processorCreators[processName] !== 'function') { + throw new Error('[' + apiContainer.options.errorTitle + '] processName: ' + processName + ' is not a function'); + } + var processor = processorCreators[processName](description, option, apiContainer); if (typeof processor === 'function') { processors.push(processor);