ming_node 2.9.7 → 2.9.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/index.js +13 -5
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * By : Minglie
4
4
  * QQ: 934031452
5
5
  * Date :2021.12.01
6
- * version :2.9.7
6
+ * version :2.9.9
7
7
  */
8
8
  var http = require('http');
9
9
  var https = require('https');
@@ -277,6 +277,7 @@ M._request = function (url, callback, data, headers,methed) {
277
277
 
278
278
  req.on('error', function (err) {
279
279
  console.error(err);
280
+ throw err;
280
281
  });
281
282
  if(methed !="GET") req.write(postData);
282
283
  req.end();
@@ -361,6 +362,7 @@ M.postJson = function (url, callback, data, headers) {
361
362
 
362
363
  req.on('error', function (err) {
363
364
  console.error(err);
365
+ throw err;
364
366
  });
365
367
  req.write(postData);
366
368
  req.end();
@@ -1074,6 +1076,7 @@ M.getMySql = function (dbConfig) {
1074
1076
  connection.beginTransaction( async function(err) {
1075
1077
  if (err) {
1076
1078
  console.error(err);
1079
+ throw err;
1077
1080
  return;
1078
1081
  }
1079
1082
  try {
@@ -1082,6 +1085,7 @@ M.getMySql = function (dbConfig) {
1082
1085
  connection.rollback(function() {
1083
1086
  console.error(e);
1084
1087
  connection.release();
1088
+ throw e;
1085
1089
  });
1086
1090
  return;
1087
1091
  }
@@ -1090,6 +1094,7 @@ M.getMySql = function (dbConfig) {
1090
1094
  connection.release();
1091
1095
  if (err) {
1092
1096
  console.error(err);
1097
+ throw err;
1093
1098
  return;
1094
1099
  }
1095
1100
  });
@@ -1600,6 +1605,7 @@ M.server = function () {
1600
1605
  fs.createReadStream(url).on("end",d=>{})
1601
1606
  .on("error",e=>{
1602
1607
  console.error(e);
1608
+ throw e;
1603
1609
  }).pipe(res);
1604
1610
  }else {
1605
1611
  var func = http;
@@ -1617,7 +1623,8 @@ M.server = function () {
1617
1623
  res.writeHead(200, {"Content-Type": "" + (privateObj.staticMime[extname] || 'text/html') + ";charset='utf-8'",});
1618
1624
  res1.on("end",d=>{})
1619
1625
  .on("error",e=>{
1620
- console.error(e)
1626
+ console.error(e);
1627
+ throw e;
1621
1628
  }).pipe(res);
1622
1629
  });
1623
1630
  }
@@ -2076,6 +2083,7 @@ M.axios = function (axiosConfig) {
2076
2083
  });
2077
2084
  req.on('error', function (err) {
2078
2085
  console.error(err);
2086
+ throw err;
2079
2087
  });
2080
2088
  req.write(axiosConfig.body);
2081
2089
  req.end();
@@ -2344,7 +2352,7 @@ privateObj.staticMime = {
2344
2352
  ".axs": "application/olescript",
2345
2353
  ".bas": "text/plain",
2346
2354
  ".bcpio": "application/x-bcpio",
2347
- ".bin ": "application/octet-stream",
2355
+ ".bin": "application/octet-stream",
2348
2356
  ".bld": "application/bld",
2349
2357
  ".bld2": "application/bld2",
2350
2358
  ".bmp": "image/bmp",
@@ -2461,8 +2469,8 @@ privateObj.staticMime = {
2461
2469
  ".jpz": "image/jpeg",
2462
2470
  ".js": "application/javascript",
2463
2471
  ".jsx": "application/javascript",
2464
- ".woff":" application/x-font-woff",
2465
- ".woff2":" application/x-font-woff",
2472
+ ".woff":"application/x-font-woff",
2473
+ ".woff2":"application/x-font-woff",
2466
2474
  ".jwc": "application/jwc",
2467
2475
  ".kjx": "application/x-kjx",
2468
2476
  ".lak": "x-lml/x-lak",
package/package.json CHANGED
@@ -46,5 +46,5 @@
46
46
  "scripts": {
47
47
  "test": "echo \"Error: no test specified\" && exit 1"
48
48
  },
49
- "version": "2.9.7"
49
+ "version": "2.9.9"
50
50
  }