@rdyl/node-koa-controller 0.2.9 → 0.3.1
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/CHANGELOG.md +1 -1
- package/dist/cache.js +1 -1
- package/dist/utils.js +11 -9
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/cache.js
CHANGED
|
@@ -118,7 +118,7 @@ var ASTCache = /** @class */ (function () {
|
|
|
118
118
|
case 3:
|
|
119
119
|
err_1 = _a.sent();
|
|
120
120
|
// @ts-ignore
|
|
121
|
-
return [2 /*return*/, instance.status.unauthorized(
|
|
121
|
+
return [2 /*return*/, instance.status.unauthorized(err_1 === null || err_1 === void 0 ? void 0 : err_1.message)];
|
|
122
122
|
case 4:
|
|
123
123
|
instance[name]();
|
|
124
124
|
return [2 /*return*/];
|
package/dist/utils.js
CHANGED
|
@@ -84,21 +84,16 @@ function getIPAdress() {
|
|
|
84
84
|
}
|
|
85
85
|
function RunningLogsHandler(ctx, next) {
|
|
86
86
|
return __awaiter(this, void 0, void 0, function () {
|
|
87
|
-
var start, duration, status_1, method, statusColor, dateTime, dText;
|
|
87
|
+
var start, duration, status_1, method, statusColor, dateTime, dText, err_1;
|
|
88
88
|
return __generator(this, function (_a) {
|
|
89
89
|
switch (_a.label) {
|
|
90
90
|
case 0:
|
|
91
91
|
start = Date.now();
|
|
92
92
|
_a.label = 1;
|
|
93
93
|
case 1:
|
|
94
|
-
_a.trys.push([1, ,
|
|
95
|
-
return [4 /*yield*/, next()];
|
|
96
|
-
case 2:
|
|
97
|
-
_a.sent();
|
|
98
|
-
return [3 /*break*/, 4];
|
|
99
|
-
case 3:
|
|
94
|
+
_a.trys.push([1, 3, , 4]);
|
|
100
95
|
duration = Date.now() - start;
|
|
101
|
-
status_1 = ctx.status;
|
|
96
|
+
status_1 = ctx.response.status;
|
|
102
97
|
method = ctx.method;
|
|
103
98
|
statusColor = void 0;
|
|
104
99
|
if (status_1 >= 500)
|
|
@@ -120,7 +115,14 @@ function RunningLogsHandler(ctx, next) {
|
|
|
120
115
|
dText = chalk_1.default.yellow("".concat(duration, "ms"));
|
|
121
116
|
}
|
|
122
117
|
console.log("- [".concat(dateTime, " | ").concat(dText, "] ").concat(chalk_1.default.magenta(method), " ").concat(ctx.url, " ").concat(statusColor(status_1)));
|
|
123
|
-
return [
|
|
118
|
+
return [4 /*yield*/, next()];
|
|
119
|
+
case 2:
|
|
120
|
+
_a.sent();
|
|
121
|
+
return [3 /*break*/, 4];
|
|
122
|
+
case 3:
|
|
123
|
+
err_1 = _a.sent();
|
|
124
|
+
console.log(err_1);
|
|
125
|
+
return [3 /*break*/, 4];
|
|
124
126
|
case 4: return [2 /*return*/];
|
|
125
127
|
}
|
|
126
128
|
});
|