Skip to content

Commit e9ef5f2

Browse files
committed
README update as per review
1 parent 8c0a5a0 commit e9ef5f2

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

README.md

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -111,19 +111,7 @@ In the example above, routing is handled with Express's built-in `app[VERB]` met
111111

112112
## Handling Errors
113113

114-
This library provides an error contructor and a handler that you can use to return JSON API-compliant errors to the user. For example, here is how you would handle 404s.
115-
116-
```javascript
117-
var API = require("json-api");
118-
var APIError = API.types.Error;
119-
120-
// Your route definitions would go here, but if none match...
121-
122-
app.use(function(req, res, next) {
123-
var err = new APIError(404, undefined, "Not Found");
124-
Front.sendError(err, req, res);
125-
});
126-
```
114+
This library provides an error contructor and a handler that you can use to return JSON API-compliant errors to the user. For an example, please see the [example repo](https://github.com/ethanresnick/json-api-example/blob/master/src/index.js#L64).
127115

128116
You can also throw an APIError inside `beforeSave`, `beforeRender`, and `beforeDelete` transforms to cancel the request.
129117

0 commit comments

Comments
 (0)