How to use the UpgradeRequired function from http-errors

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

111
112
113
114
115
116
117
118
119
120
tooEarly: function tooEarly (message) {
  return new createError.TooEarly(message)
},

upgradeRequired: function upgradeRequired (message) {
  return new createError.UpgradeRequired(message)
},

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

+ 55 other calls in file

164
165
166
167
168
169
170
171
172
173
module.exports.MisdirectedRequest = new HTTPErrors.MisdirectedRequest()
module.exports.UnprocessableEntity = new HTTPErrors.UnprocessableEntity()
module.exports.Locked = new HTTPErrors.Locked()
module.exports.FailedDependency = new HTTPErrors.FailedDependency()
module.exports.UnorderedCollection = new HTTPErrors.UnorderedCollection()
module.exports.UpgradeRequired = new HTTPErrors.UpgradeRequired()
module.exports.PreconditionRequired = new HTTPErrors.PreconditionRequired()
module.exports.TooManyRequests = new HTTPErrors.TooManyRequests()
module.exports.RequestHeaderFieldsTooLarge = new HTTPErrors.RequestHeaderFieldsTooLarge()
module.exports.UnavailableForLegalReasons = new HTTPErrors.UnavailableForLegalReasons()
fork icon1
star icon0
watch icon7

+ 41 other calls in file

145
146
147
148
149
150
151
152
153
154
case 425: {
  httpError = createError.UnorderedCollection();
  break;
}
case 426: {
  httpError = createError.UpgradeRequired();
  break;
}
case 429: {
  httpError = createError.TooManyRequests();
fork icon0
star icon0
watch icon2

+ 41 other calls in file