Skip to content

Commit 097da9c

Browse files
committed
Improve README
1 parent 5a43394 commit 097da9c

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,30 +163,28 @@ set to an empty object.
163163
```js
164164
export const BaseError = ModernError.subclass('BaseError', {
165165
plugins: [modernErrorsHttp],
166-
http: { ...options },
166+
http: options,
167167
})
168168
```
169169

170170
- Any error of a specific class (and its subclasses): second argument to
171171
[`ErrorClass.subclass()`](https://github.com/ehmicky/modern-errors#options-1)
172172

173173
```js
174-
export const AuthError = BaseError.subclass('AuthError', {
175-
http: { ...options },
176-
})
174+
export const AuthError = BaseError.subclass('AuthError', { http: options })
177175
```
178176

179177
- A specific error: second argument to
180178
[`new ErrorClass()`](https://github.com/ehmicky/modern-errors#options-3)
181179

182180
```js
183-
throw new AuthError('...', { http: { ...options } })
181+
throw new AuthError('...', { http: options })
184182
```
185183

186184
- A specific [`BaseError.httpResponse(error)`](#baseerrorhttpresponseerror) call
187185

188186
```js
189-
BaseError.httpResponse(error, { ...options })
187+
BaseError.httpResponse(error, options)
190188
```
191189

192190
# Related projects

0 commit comments

Comments
 (0)