@nxtedition/lib 16.0.3 → 16.0.5
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/http.js +4 -16
- package/logger.js +1 -1
- package/package.json +1 -1
package/http.js
CHANGED
|
@@ -67,29 +67,17 @@ export async function request(ctx, next) {
|
|
|
67
67
|
.on('error', function (err) {
|
|
68
68
|
this.log.error({ err }, 'request error')
|
|
69
69
|
})
|
|
70
|
-
.on('end', function () {
|
|
71
|
-
this.log.trace('request end')
|
|
72
|
-
})
|
|
73
|
-
.on('close', function () {
|
|
74
|
-
this.log.trace('request close')
|
|
75
|
-
})
|
|
76
70
|
res
|
|
77
71
|
.on('timeout', function () {
|
|
78
72
|
this.destroy(new createError.RequestTimeout())
|
|
79
73
|
})
|
|
80
74
|
.on('error', function (err) {
|
|
81
|
-
|
|
82
|
-
})
|
|
83
|
-
.on('finish', function () {
|
|
84
|
-
this.log.trace('response finish')
|
|
75
|
+
reject(err)
|
|
85
76
|
})
|
|
77
|
+
// TODO (fix): Use 'end' once we can trust that
|
|
78
|
+
// 'end' or 'error' will always be emitted.
|
|
86
79
|
.on('close', function () {
|
|
87
|
-
|
|
88
|
-
if (this.errored) {
|
|
89
|
-
reject(this.errored)
|
|
90
|
-
} else {
|
|
91
|
-
resolve(null)
|
|
92
|
-
}
|
|
80
|
+
resolve(null)
|
|
93
81
|
})
|
|
94
82
|
}),
|
|
95
83
|
])
|
package/logger.js
CHANGED