Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b91c7ff

Browse files
committedApr 11, 2022
examples: use http-errors to create errors
1 parent ecaf67c commit b91c7ff

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed
 

‎examples/params/index.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* Module dependencies.
55
*/
66

7+
var createError = require('http-errors')
78
var express = require('../../');
89
var app = module.exports = express();
910

@@ -17,14 +18,6 @@ var users = [
1718
, { name: 'bandit' }
1819
];
1920

20-
// Create HTTP error
21-
22-
function createError(status, message) {
23-
var err = new Error(message);
24-
err.status = status;
25-
return err;
26-
}
27-
2821
// Convert :to and :from to integers
2922

3023
app.param(['to', 'from'], function(req, res, next, num, name){

0 commit comments

Comments
 (0)
Please sign in to comment.