How to use the RequestTimeout function from http-errors

Find comprehensive JavaScript http-errors.RequestTimeout code examples handpicked from public code repositorys.

47
48
49
50
51
52
53
54
55
56
proxyAuthenticationRequired: function proxyAuthenticationRequired (message) {
  return new createError.ProxyAuthenticationRequired(message)
},

requestTimeout: function requestTimeout (message) {
  return new createError.RequestTimeout(message)
},

conflict: function conflict (message) {
  return new createError.Conflict(message)
fork icon30
star icon340
watch icon17

+ 55 other calls in file

73
74
75
76
77
78
79
80
81
82
        resolve(null)
      }
    })
    .on('error', reject)
    .on('timeout', () => {
      reject(new createError.RequestTimeout())
    })
}),
next().catch((err) => {
  if (!res.headersSent) {
fork icon4
star icon3
watch icon5

+ 39 other calls in file

148
149
150
151
152
153
154
155
156
157
module.exports.Forbidden = new HTTPErrors.Forbidden()
module.exports.NotFound = new HTTPErrors.NotFound()
module.exports.MethodNotAllowed = new HTTPErrors.MethodNotAllowed()
module.exports.NotAcceptable = new HTTPErrors.NotAcceptable()
module.exports.ProxyAuthenticationRequired = new HTTPErrors.ProxyAuthenticationRequired()
module.exports.RequestTimeout = new HTTPErrors.RequestTimeout()
module.exports.Conflict = new HTTPErrors.Conflict()
module.exports.Gone = new HTTPErrors.Gone()
module.exports.LengthRequired = new HTTPErrors.LengthRequired()
module.exports.PreconditionFailed = new HTTPErrors.PreconditionFailed()
fork icon1
star icon0
watch icon7

+ 41 other calls in file

81
82
83
84
85
86
87
88
89
90
case 407: {
  httpError = createError.ProxyAuthenticationRequired();
  break;
}
case 408: {
  httpError = createError.RequestTimeout();
  break;
}
case 409: {
  httpError = createError.Conflict();
fork icon0
star icon0
watch icon2

+ 41 other calls in file