How to use the UnavailableForLegalReasons function from http-errors

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

127
128
129
130
131
132
133
134
135
136
requestHeaderFieldsTooLarge: function requestHeaderFieldsTooLarge (message) {
  return new createError.RequestHeaderFieldsTooLarge(message)
},

unavailableForLegalReasons: function unavailableForLegalReasons (message) {
  return new createError.UnavailableForLegalReasons(message)
},

internalServerError: function internalServerError (message) {
  const error = new createError.InternalServerError(message)
fork icon30
star icon340
watch icon17

+ 55 other calls in file

168
169
170
171
172
173
174
175
176
177
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()
module.exports.InternalServerError = new HTTPErrors.InternalServerError()
module.exports.NotImplemented = new HTTPErrors.NotImplemented()
module.exports.BadGateway = new HTTPErrors.BadGateway()
module.exports.ServiceUnavailable = new HTTPErrors.ServiceUnavailable()
fork icon1
star icon0
watch icon7

+ 41 other calls in file

157
158
159
160
161
162
163
164
165
166
case 431: {
  httpError = createError.RequestHeaderFieldsTooLarge();
  break;
}
case 451: {
  httpError = createError.UnavailableForLegalReasons();
  break;
}
case 501: {
  httpError = createError.NotImplemented();
fork icon0
star icon0
watch icon2

+ 41 other calls in file