Skip to content

Commit 97fc1a3

Browse files
committed
Update README
1 parent f48110e commit 97fc1a3

File tree

1 file changed

+27
-25
lines changed

1 file changed

+27
-25
lines changed

README.md

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -104,31 +104,6 @@ restore()
104104

105105
_Type_: `object`
106106

107-
Options must be passed either to
108-
[`ModernError.subclass()`](https://github.com/ehmicky/modern-errors#options-1).
109-
110-
```js
111-
export const BaseError = ModernError.subclass('BaseError', {
112-
plugins: [modernErrorsProcess],
113-
process: options,
114-
})
115-
```
116-
117-
To
118-
[`UnknownError.subclass()`](https://github.com/ehmicky/modern-errors#options-1).
119-
120-
```js
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)
130-
```
131-
132107
### exit
133108

134109
_Type_: `boolean`
@@ -172,6 +147,33 @@ Process event name among:
172147
[`'rejectionHandled'`](https://nodejs.org/api/process.html#process_event_rejectionhandled),
173148
[`'warning'`](https://nodejs.org/api/process.html#process_event_warning).
174149

150+
## Configuration
151+
152+
[Options](#options) must be passed either to
153+
[`ModernError.subclass()`](https://github.com/ehmicky/modern-errors#options-1).
154+
155+
```js
156+
export const BaseError = ModernError.subclass('BaseError', {
157+
plugins: [modernErrorsProcess],
158+
process: options,
159+
})
160+
```
161+
162+
To
163+
[`UnknownError.subclass()`](https://github.com/ehmicky/modern-errors#options-1).
164+
165+
```js
166+
export const UnknownError = BaseError.subclass('UnknownError', {
167+
process: options,
168+
})
169+
```
170+
171+
Or to [`UnknownError.logProcess()`](#errorclasslogprocess).
172+
173+
```js
174+
UnknownError.logProcess(...args, options)
175+
```
176+
175177
# Related projects
176178

177179
- [`log-process-errors`](https://github.com/ehmicky/log-process-errors): Show

0 commit comments

Comments
 (0)