Invalid access of discarded (invalid, deleted) uWS.HttpResponse/SSLHttpResponse. #123
Answered
by
ghost
cmnstmntmn
asked this question in
Q&A
-
i'm having the following context:
the
and a piece of code: .get('/api/order/:id', (res, req) => {
let order_id = req.getParameter(0);
db.getOrderById(res, order_id, (data) => {
res.writeStatus("201");
res.end(JSON.stringify({
status: 201,
message: "Order",
data: data
}));
}, () => {
res.writeStatus("404");
res.end(JSON.stringify({
status: 404,
message: "Error"
}));
})
}) and the query function, somehow simmilar to function getOrderById(res, order_id, cb, err) {
res.onData( () => {
db.all(`SELECT id, machine, type, created_at FROM orders WHERE id="${order_id}"`, function(err, rows) {
!err ? cb(rows[0]) : cb(err);
})
})
res.onAborted(err)
} |
Beta Was this translation helpful? Give feedback.
Answered by
ghost
Apr 9, 2019
Replies: 1 comment 1 reply
-
You can look over the docs regarding onAborted - you have to track whether the response was aborted or not. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can look over the docs regarding onAborted - you have to track whether the response was aborted or not.