Skip to content

Commit 7dc7387

Browse files
committed
chore: Updated README.
1 parent f951a49 commit 7dc7387

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ The handler response format will compatible with standard fastify error response
3232
```typescript
3333
{
3434
statusCode: number
35-
code?: string
3635
error: string
3736
message: string
3837
}
@@ -44,13 +43,13 @@ To clarify, take this server as a example:
4443

4544
```js
4645
const server = require('fastify')()
47-
const createError = require('http-errors')
46+
const { NotFoundError } = require('http-errors-enhanced')
4847

4948
server.register(require('fastify-http-errors-enhanced'))
5049

5150
server.get('/invalid', {
5251
handler: async function (request, reply) {
53-
throw createError(404, 'You are not supposed to reach this.', { header: { 'X-Req-Id': request.id, id: 123 } })
52+
throw new NotFoundError('You are not supposed to reach this.', { header: { 'X-Req-Id': request.id, id: 123 } })
5453
}
5554
})
5655

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
},
1616
"author": "Shogun <shogun@cowtech.it>",
1717
"license": "ISC",
18+
"private": false,
1819
"files": [
1920
"lib",
2021
"types",

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
"strictNullChecks": true,
1717
"declaration": true
1818
},
19-
"include": ["src/**/*.ts"],
19+
"include": ["src/*.ts"],
2020
"exclude": []
2121
}

tsconfig.test.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"extends": "./tsconfig.json",
3-
"include": ["src/**/*.ts", "test/**/*.ts"]
3+
"include": ["src/*.ts", "test/*.ts"]
44
}

0 commit comments

Comments
 (0)