ming_node 2.9.7 → 2.9.8
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +10 -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.
|
6
|
+
* version :2.9.8
|
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();
|
package/package.json
CHANGED