Closed mcarboni-redant closed 7 years ago
@mcarboni-redant how are you handling errors that get raised from ipfilter?
Hello @ryanbillingsley , I'm using the following code:
app.use(function(err, req, res) {
console.error('Error handler', err)
res.sendStatus(err.status || 500)
})
But seems that isn't reached
@ryanbillingsley I've solved, I didn't know that express counts the number of arguments to know which functions are error handlers
@mcarboni-redant great, glad you found a solution 👍
Can I suggest to put in the readme a little section about error handling for Ip Filter?
From the code in the folder "examples" I've found that the package exports an error type called IpDeniedError.
@mcarboni-redant yes, that is a good idea. thanks
Added documentation
When the server receives a request from a blacklisted IP, the server crashes immediately.