Skip to content
This repository was archived by the owner on May 8, 2020. It is now read-only.

Commit 27226e2

Browse files
author
Travis
committed
chore:Update docs
1 parent 14b8247 commit 27226e2

File tree

102 files changed

+3
-1568
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+3
-1568
lines changed

β€Ždocs/README.md

-35
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,3 @@
22

33
> HTTP Exceptions for REST API based on Express.js
44
5-
See [guide installation](getting-started.md) and our [API](api/index.md)
6-
7-
## Example
8-
9-
```typescript
10-
import {BadRequest, Exception} from 'ts-httpexceptions';
11-
let express = require('express');
12-
let app = express();
13-
14-
app.get('/my/route', (req, res) => {
15-
16-
throw new BadRequest('Custom Message'); //Emit
17-
// OR
18-
// throw new Exception(510, 'Custom Message');
19-
20-
});
21-
22-
app.get('/my/route/params', (req, res) => {
23-
24-
if (req.params.id === undefined){
25-
throw new BadRequest();
26-
}
27-
28-
});
29-
30-
31-
//GlobalHandler middleware catch exception and send response to the client
32-
app.use((err, request, response) => {
33-
34-
if(err instanceof Exception){
35-
response.status(err.status).send(err.message);
36-
}
37-
38-
});
39-
```

β€Ždocs/_coverpage.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
- Extensible
99
- ES6/Typescript
1010

11-
[GitHub](https://github.com/TypeProject/ts-httpexceptions/)
12-
[Get Started](#tshttpexceptions)
11+
[GitHub](https://github.com/TypedProject/tsed/)
12+
[Get Started](https://tsed.io/docs/exceptions.html)
1313

β€Ždocs/_navbar.md

-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
11

2-
- <div class="ps-icon ps-icon-arrow-right"></div> [Getting started](getting-started.md)
3-
- <div class="ps-icon ps-icon-puzzle"></div> [API references](api/index.md)
42

β€Ždocs/_sidebar.md

-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +0,0 @@
1-
* [<div class="ps-icon ps-icon-arrow-right"></div> Getting started](getting-started.md)
2-
* [<div class="ps-icon ps-icon-puzzle"></div> API references](api/index.md)
3-
* [<div class="ps-icon ps-icon-github-alt"></div> Contributing](contributing.md)
4-
* [<div class="ps-icon ps-icon-file"></div> License](license.md)

β€Ždocs/api/common/badgateway.md

-16
This file was deleted.

β€Ždocs/api/common/badmapping.md

-16
This file was deleted.

β€Ždocs/api/common/badrequest.md

-16
This file was deleted.

β€Ždocs/api/common/bandwidthlimitexceeded.md

-16
This file was deleted.

β€Ždocs/api/common/clientErrors/badmapping.md

-13
This file was deleted.

β€Ždocs/api/common/clientErrors/badrequest.md

-13
This file was deleted.

β€Ždocs/api/common/clientErrors/conflict.md

-13
This file was deleted.

β€Ždocs/api/common/clientErrors/expectationfailed.md

-13
This file was deleted.

0 commit comments

Comments
Β (0)