@be-link/pos-cli-nodejs 0.0.89 → 0.0.90
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/pos/http.js +2 -2
package/package.json
CHANGED
package/pos/http.js
CHANGED
|
@@ -9,8 +9,8 @@ const uuid_1 = require("uuid");
|
|
|
9
9
|
const BizError_1 = __importDefault(require("../errors/BizError"));
|
|
10
10
|
const SystemError_1 = __importDefault(require("../errors/SystemError"));
|
|
11
11
|
async function callApi(url, ...request) {
|
|
12
|
+
const requestId = (0, uuid_1.v4)();
|
|
12
13
|
try {
|
|
13
|
-
const requestId = (0, uuid_1.v4)();
|
|
14
14
|
console.info(`准备发起POS请求[${requestId}]: ${url}, 参数: ${JSON.stringify(request)}`);
|
|
15
15
|
const response = await axios_1.default.post(url, request[0], {
|
|
16
16
|
headers: {
|
|
@@ -30,7 +30,7 @@ async function callApi(url, ...request) {
|
|
|
30
30
|
if (axiosError.response) {
|
|
31
31
|
const response = axiosError.response;
|
|
32
32
|
const data = response.data;
|
|
33
|
-
console.error(`POS 异常: ${axiosError.message}`);
|
|
33
|
+
console.error(`POS 异常: ${axiosError.message},requestId: ${requestId}`);
|
|
34
34
|
console.info('响应信息', data.message);
|
|
35
35
|
console.error('异常堆栈', JSON.stringify(error.stack));
|
|
36
36
|
throw new ErrorClass(data.message || 'Pos Error', response.status);
|