|
1 |
| -import { incrementer } from '@intlify/shared' |
2 |
| -import { CoreErrorCodes, createCompileError } from '@intlify/core-base' |
| 1 | +import { |
| 2 | + createCompileError, |
| 3 | + CORE_ERROR_CODES_EXTEND_POINT |
| 4 | +} from '@intlify/core-base' |
3 | 5 |
|
4 | 6 | import type { BaseError } from '@intlify/shared'
|
5 | 7 |
|
6 | 8 | export interface I18nError extends BaseError {}
|
7 | 9 |
|
8 |
| -const code = CoreErrorCodes.__EXTEND_POINT__ |
9 |
| -const inc = incrementer(code) |
10 |
| - |
11 | 10 | export const I18nErrorCodes = {
|
12 | 11 | // composer module errors
|
13 |
| - UNEXPECTED_RETURN_TYPE: code, // 24 |
| 12 | + UNEXPECTED_RETURN_TYPE: CORE_ERROR_CODES_EXTEND_POINT, // 24 |
14 | 13 | // legacy module errors
|
15 |
| - INVALID_ARGUMENT: inc(), // 25 |
| 14 | + INVALID_ARGUMENT: 25, |
16 | 15 | // i18n module errors
|
17 |
| - MUST_BE_CALL_SETUP_TOP: inc(), // 26 |
18 |
| - NOT_INSTALLED: inc(), // 27 |
| 16 | + MUST_BE_CALL_SETUP_TOP: 26, |
| 17 | + NOT_INSTALLED: 27, |
19 | 18 | // directive module errors
|
20 |
| - REQUIRED_VALUE: inc(), // 28 |
21 |
| - INVALID_VALUE: inc(), // 29 |
| 19 | + REQUIRED_VALUE: 28, |
| 20 | + INVALID_VALUE: 29, |
22 | 21 | // vue-devtools errors
|
23 |
| - CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN: inc(), // 30 |
24 |
| - NOT_INSTALLED_WITH_PROVIDE: inc(), // 31 |
| 22 | + CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN: 30, |
| 23 | + NOT_INSTALLED_WITH_PROVIDE: 31, |
25 | 24 | // unexpected error
|
26 |
| - UNEXPECTED_ERROR: inc(), // 32 |
| 25 | + UNEXPECTED_ERROR: 32, |
27 | 26 | // not compatible legacy vue-i18n constructor
|
28 |
| - NOT_COMPATIBLE_LEGACY_VUE_I18N: inc(), // 33 |
| 27 | + NOT_COMPATIBLE_LEGACY_VUE_I18N: 33, |
29 | 28 | // Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly
|
30 |
| - NOT_AVAILABLE_COMPOSITION_IN_LEGACY: inc(), // 34 |
31 |
| - // for enhancement |
32 |
| - __EXTEND_POINT__: inc() // 35 |
| 29 | + NOT_AVAILABLE_COMPOSITION_IN_LEGACY: 34 |
33 | 30 | } as const
|
34 | 31 |
|
35 | 32 | type I18nErrorCodes = (typeof I18nErrorCodes)[keyof typeof I18nErrorCodes]
|
|
0 commit comments