Skip to content

Commit 0c9da91

Browse files
committed
updated readme
1 parent 3966115 commit 0c9da91

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,15 @@ console.log(err.httpStatusCode); // 403
5252

5353
### Wrapping a Native Error
5454

55-
If you want to extend a native error, you can use `.from()`
55+
If you want to extend a native error, you can pass in the entire `err` instance.
5656

5757
```js
5858
const { PermissionsError } = require('@conjurelabs/err');
5959

6060
try {
6161
await checkPermissions();
6262
} catch(err) {
63-
const permErr = PermissionsError.from(err);
64-
throw permErr;
63+
throw new PermissionsError(err);
6564
}
6665
```
6766

@@ -71,4 +70,3 @@ try {
7170
npm test
7271
npm run lint
7372
```
74-

0 commit comments

Comments
 (0)