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