Skip to content

Commit 23b2cef

Browse files
committed
Fix README
1 parent 45b4423 commit 23b2cef

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

README.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,14 @@ import modernErrorsProcess from 'modern-errors-process'
4444
export const BaseError = ModernError.subclass('BaseError', {
4545
plugins: [modernErrorsProcess],
4646
})
47+
export const UnknownError = BaseError.subclass('UnknownError')
4748
// ...
4849
```
4950

50-
[Initializing](#baseerrorlogprocess) the process error handler.
51+
[Initializing](#errorclasslogprocess) the process error handler.
5152

5253
```js
53-
BaseError.logProcess()
54+
UnknownError.logProcess()
5455
```
5556

5657
# Install
@@ -86,7 +87,7 @@ Plugin object to pass to the
8687
[`plugins` option](https://github.com/ehmicky/modern-errors#adding-plugins) of
8788
`ErrorClass.subclass()`.
8889

89-
## BaseError.logProcess()
90+
## ErrorClass.logProcess()
9091

9192
_Return value_: `() => void`
9293

@@ -95,7 +96,7 @@ Start handling process errors.
9596
The return value restores Node.js default behavior.
9697

9798
```js
98-
const restore = BaseError.logProcess()
99+
const restore = UnknownError.logProcess()
99100
restore()
100101
```
101102

@@ -113,10 +114,19 @@ export const BaseError = ModernError.subclass('BaseError', {
113114
})
114115
```
115116

116-
Or to [`BaseError.logProcess()`](#baseerrorlogprocess).
117+
To
118+
[`UnknownError.subclass()`](https://github.com/ehmicky/modern-errors#options-1).
117119

118120
```js
119-
BaseError.logProcess(...args, options)
121+
export const UnknownError = BaseError.subclass('UnknownError', {
122+
process: options,
123+
})
124+
```
125+
126+
Or to [`UnknownError.logProcess()`](#errorclasslogprocess).
127+
128+
```js
129+
UnknownError.logProcess(...args, options)
120130
```
121131

122132
### exit

types/main.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ declare const plugin: {
2929
*
3030
* @example
3131
* ```js
32-
* const restore = BaseError.logProcess()
32+
* const restore = UnknownError.logProcess()
3333
* restore()
3434
* ```
3535
*/

0 commit comments

Comments
 (0)