You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var http = require('http');
var connect = require('connect');
var domainMiddleware = require('domain-middleware');
var server = http.createServer();
var app = connect()
.use(
domainMiddleware({
server: server,
killTimeout: 30000,
}),
)
.use(function (req, res) {
// most handling logic is async in the real world
async function f(res){
if (Math.random() > 0.5) {
throw new Error('Asynchronous error from timeout');
} else {
res.end('Hello from Connect!');
}
}
f(); // this is not caught
})
.use(function (err, req, res, next) {
res.end(err.message);
});
server.on('request', app);
server.listen(1984);
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: