hc-service-client
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -5,2 +5,3 @@ 'use strict'; | ||
const ServiceClient = require('./lib/service_client'); | ||
const util = require('./lib/util'); | ||
@@ -15,3 +16,3 @@ module.exports = function (app, config) { | ||
if (ridHeader && typeof ridHeader !== 'string') { | ||
throw 'fault [service-client]: ridHeader should be an string'; | ||
throw util.errorWrapper('[service-client]: ridHeader should be an string'); | ||
} | ||
@@ -24,3 +25,3 @@ | ||
log.error('the service config: ', app.config.services); | ||
throw new Error(`Can not find ${serviceCode}'s service config.`); | ||
throw util.errorWrapper(`[service-client]: Can not find ${serviceCode}'s service config.`); | ||
} | ||
@@ -27,0 +28,0 @@ |
@@ -10,2 +10,3 @@ 'use strict'; | ||
const qs = require('qs'); | ||
const util = require('./util'); | ||
@@ -15,3 +16,3 @@ class ServiceClient { | ||
if (!options.endpoint && !options.endPoint) { | ||
throw '[hc-service-client]: endpoint is required.'; | ||
throw util.errorWrapper('[hc-service-client]: endpoint is required.'); | ||
} | ||
@@ -22,3 +23,3 @@ if (!options.endpoint) { | ||
if (!options.accessKeySecret) { | ||
throw '[hc-service-client]: accessKeySecret is required.'; | ||
throw util.errorWrapper('[hc-service-client]: accessKeySecret is required.'); | ||
} | ||
@@ -43,3 +44,3 @@ this.rid = options.rid; // rid | ||
if (!this.log.debug) { | ||
throw '[hc-service-client]: `log` instance should have debug function.'; | ||
throw util.errorWrapper('[hc-service-client]: `log` instance should have debug function.'); | ||
} | ||
@@ -46,0 +47,0 @@ this.disableFileSignature = options.disableFileSignature; // 禁用文件签名 |
{ | ||
"name": "hc-service-client", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Service Client Extension for Honeybee", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
38180
14
814