How to use the NotExtended function from http-errors

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

174
175
176
177
178
179
180
181
182
183
bandwidthLimitExceeded: function bandwidthLimitExceeded (message) {
  return new createError.BandwidthLimitExceeded(message)
},

notExtended: function notExtended (message) {
  return new createError.NotExtended(message)
},

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

+ 55 other calls in file

163
164
165
166
167
168
169
170
171
172
},
refreshTokenControllers: async (req, res) => {
  try {
    const data = req.data

    if (!data) throw new createErrors.NotExtended('Session not found')

    const user = await knex.select('email').from('users').where('email', data.email).first()

    if (!user) throw new createErrors.ExpectationFailed('Unregistered account')
fork icon4
star icon2
watch icon0

179
180
181
182
183
184
185
module.exports.HTTPVersionNotSupported = new HTTPErrors.HTTPVersionNotSupported()
module.exports.VariantAlsoNegotiates = new HTTPErrors.VariantAlsoNegotiates()
module.exports.InsufficientStorage = new HTTPErrors.InsufficientStorage()
module.exports.LoopDetected = new HTTPErrors.LoopDetected()
module.exports.BandwidthLimitExceeded = new HTTPErrors.BandwidthLimitExceeded()
module.exports.NotExtended = new HTTPErrors.NotExtended()
module.exports.NetworkAuthenticationRequired = new HTTPErrors.NetworkAuthenticationRequired()
fork icon1
star icon0
watch icon7

+ 41 other calls in file

252
253
254
255
256
257
258
259
260
261
},
refreshTokenControllers: async (req, res) => {
  try {
    const data = req.data

    if (!data) throw new createErrors.NotExtended('Session not found!')

    const user = await getUserByIdModels(false, [data.email], 'email = $1')

    if (!user) throw new createErrors.ExpectationFailed('Unregistered account!')
fork icon0
star icon0
watch icon0

+ 11 other calls in file

197
198
199
200
201
202
203
204
205
206
case 509: {
  httpError = createError.BandwidthLimitExceeded();
  break;
}
case 510: {
  httpError = createError.NotExtended();
  break;
}
case 511: {
  httpError = createError.NetworkAuthenticationRequired();
fork icon0
star icon0
watch icon2

+ 41 other calls in file