mirror of
https://github.com/goldbergyoni/nodebestpractices.git
synced 2025-10-27 19:17:13 +08:00
Reflecion of #589
This commit is contained in:
@ -8,10 +8,10 @@ Express поставляется со встроенным обработчик
|
||||
|
||||
### Пример кода: экспресс-обработчик ошибок
|
||||
|
||||
``` javascript
|
||||
```javascript
|
||||
// production error handler
|
||||
// no stacktraces leaked to user
|
||||
app.use(function(err, req, res, next) {
|
||||
app.use((err, req, res, next) => {
|
||||
res.status(err.status || 500);
|
||||
res.render('error', {
|
||||
message: err.message,
|
||||
|
||||
Reference in New Issue
Block a user