Skip to content

Commit f51cc5c

Browse files
committed
Rename AnyError to BaseError
1 parent eeff133 commit f51cc5c

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ details") to use in an HTTP response.
2828
import modernErrors from 'modern-errors'
2929
import modernErrorsHttp from 'modern-errors-http'
3030

31-
export const AnyError = modernErrors([modernErrorsHttp])
31+
export const BaseError = modernErrors([modernErrorsHttp])
3232
```
3333

3434
[Configuring](#configuration) error fields.
3535

3636
```js
37-
export const AuthError = AnyError.subclass('AuthError', {
37+
export const AuthError = BaseError.subclass('AuthError', {
3838
http: {
3939
type: 'https://example.com/probs/auth',
4040
status: 401,
@@ -156,14 +156,14 @@ set to an empty object.
156156
[`modernErrors()`](https://github.com/ehmicky/modern-errors#modernerrorsplugins-options)
157157

158158
```js
159-
export const AnyError = modernErrors(plugins, { http: { ...options } })
159+
export const BaseError = modernErrors(plugins, { http: { ...options } })
160160
```
161161

162162
- Any error of multiple classes: using
163-
[`ErrorClass.subclass()`](https://github.com/ehmicky/modern-errors#anyerrorsubclassname-options)
163+
[`ErrorClass.subclass()`](https://github.com/ehmicky/modern-errors#baseerrorsubclassname-options)
164164

165165
```js
166-
export const SharedError = AnyError.subclass('SharedError', {
166+
export const SharedError = BaseError.subclass('SharedError', {
167167
http: { ...options },
168168
})
169169

@@ -172,10 +172,10 @@ export const InputError = SharedError.subclass('InputError')
172172
```
173173

174174
- Any error of a specific class: second argument to
175-
[`AnyError.subclass()`](https://github.com/ehmicky/modern-errors#anyerrorsubclassname-options)
175+
[`BaseError.subclass()`](https://github.com/ehmicky/modern-errors#baseerrorsubclassname-options)
176176

177177
```js
178-
export const AuthError = AnyError.subclass('AuthError', {
178+
export const AuthError = BaseError.subclass('AuthError', {
179179
http: { ...options },
180180
})
181181
```

test/helpers/main.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import modernErrors from 'modern-errors'
22
import modernErrorsHttp from 'modern-errors-http'
33

4-
const AnyError = modernErrors([modernErrorsHttp])
5-
AnyError.subclass('UnknownError')
6-
export const TestError = AnyError.subclass('TestError')
4+
const BaseError = modernErrors([modernErrorsHttp])
5+
BaseError.subclass('UnknownError')
6+
export const TestError = BaseError.subclass('TestError')
77
export const testError = new TestError('test')

types/main.test-d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import {
77
expectError,
88
} from 'tsd'
99

10-
const AnyError = modernErrors([plugin])
11-
const error = new AnyError('', { cause: '' })
10+
const BaseError = modernErrors([plugin])
11+
const error = new BaseError('', { cause: '' })
1212
const httpResponse = error.httpResponse()
1313

1414
modernErrors([plugin], { http: {} })

0 commit comments

Comments
 (0)