Skip to content

Commit 32cc41c

Browse files
committed
Update README
1 parent 888c478 commit 32cc41c

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Plugin object to
8484

8585
_Return value_: `HttpResponse`
8686

87-
Convert `error` to a plain object to use in an HTTP response. Its shape follows
87+
Converts `error` to a plain object to use in an HTTP response. Its shape follows
8888
[RFC 7807](https://www.rfc-editor.org/rfc/rfc7807) ("problem details").
8989

9090
## Options
@@ -97,7 +97,7 @@ _Type_: `urlString`\
9797
_Default_: `undefined`
9898

9999
URI identifying and documenting the error class. Ideally, each error class
100-
[should set one](https://github.com/ehmicky/modern-errors/README.md#plugin-options).
100+
[should set one](#configuration).
101101

102102
### status
103103

@@ -162,28 +162,26 @@ export const SharedError = AnyError.subclass('SharedError', {
162162
http: { ...options },
163163
})
164164

165-
export const InputError = SharedError.subclass('InputError')
166165
export const AuthError = SharedError.subclass('AuthError')
166+
export const InputError = SharedError.subclass('InputError')
167167
```
168168

169169
- Any error of a specific class: second argument to
170170
[`AnyError.subclass()`](https://github.com/ehmicky/modern-errors#anyerrorsubclassname-options)
171171

172172
```js
173-
export const InputError = AnyError.subclass('InputError', {
173+
export const AuthError = AnyError.subclass('AuthError', {
174174
http: { ...options },
175175
})
176176
```
177177

178178
- A specific error: second argument to the error's constructor
179179

180180
```js
181-
throw new InputError('...', { http: { ...options } })
181+
throw new AuthError('...', { http: { ...options } })
182182
```
183183

184-
- A specific
185-
[`error.httpResponse()`](https://github.com/ehmicky/modern-errors#errorhttpresponse)
186-
call
184+
- A specific [`error.httpResponse()`](#errorhttpresponse) call
187185

188186
```js
189187
error.httpResponse(...args, { ...options })

0 commit comments

Comments
 (0)