-
Notifications
You must be signed in to change notification settings - Fork 54
Expand file tree
/
Copy patherror.ts
More file actions
78 lines (75 loc) · 3.77 KB
/
error.ts
File metadata and controls
78 lines (75 loc) · 3.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import {
DataTypeMap,
MAX_PARTITIONS_NUMBER,
MAX_PARTITION_KEY_FIELD_COUNT,
} from './';
export const ERROR_REASONS = {
MILVUS_ADDRESS_IS_REQUIRED: 'The `address` property is missing.',
CREATE_COLLECTION_MISS_DATA_TYPE:
'The `data_type` property is missing in the `field` object.',
CREATE_COLLECTION_CHECK_PARAMS:
'The `fields` or `collection_name` property is missing.',
CREATE_COLLECTION_CHECK_PRIMARY_KEY:
'The `data_type` for the primary key field must be DataType.Int64.',
CREATE_COLLECTION_CHECK_VECTOR_FIELD_EXIST:
'The `data_type` of a vector field must be either DataType.FloatVector or DataType.BinaryVector.',
CREATE_COLLECTION_CHECK_MISS_DIM: 'The `dim` property is missing.',
CREATE_COLLECTION_CHECK_MISS_MAX_LENGTH:
'The `max_length` property is missing',
CREATE_COLLECTION_CHECK_BINARY_DIM:
'The `dim` property of the Binary vector should be value multiples of 8.',
COLLECTION_NAME_IS_REQUIRED: 'The `collection_name` property is missing.',
COLLECTION_ID_IS_REQUIRED: 'The `collectionID` property is missing.',
COLLECTION_PARTITION_NAME_ARE_REQUIRED:
'The `collection_name` or the `partition_name` property is missing.',
INSERT_CHECK_FIELD_DATA_IS_REQUIRED:
'The type of the `data or field_data` should be an array and length > 0.',
INSERT_CHECK_WRONG_FIELD:
'Insert fail: some field does not exist for this collection in line.',
INSERT_CHECK_WRONG_DIM:
'Insert fail: the length of the binary vector should be (dimension / 8).',
INSERT_CHECK_WRONG_DATA_TYPE:
'The value of the `data_type` property is not supported:',
GET_METRIC_CHECK_PARAMS: 'The `metric_type` property is missing.',
GET_FLUSH_STATE_CHECK_PARAMS:
'The type of the `segmentIDs` property should be an array.',
LOAD_BALANCE_CHECK_PARAMS: 'The `src_nodeID` property is missing.',
PARTITION_NAMES_IS_REQUIRED: 'The `partition_names` property is missing.',
ALIAS_NAME_IS_REQUIRED: 'The `alias` property is missing.',
COMPACTION_ID_IS_REQUIRED: 'The `compactionID` property is missing.',
USERNAME_PWD_ARE_REQUIRED:
'The `username` or `password` property is missing.',
USERNAME_IS_REQUIRED: 'The `username` property is missing.',
FILTER_EXPR_REQUIRED: 'The `filter` or the `expr` property is missing.',
TIMESTAMP_PARAM_CHECK:
'The type of the `hybridts` property should be string (only contains number) or bigint.',
DATE_TYPE_CHECK: 'The type of the `datetime` property should be Date.',
IMPORT_FILE_CHECK: 'The `files` property is missing.',
SEARCH_PARAMS_IS_NOT_MATCH: 'Some of the search parameters are not match.',
VECTORS_OR_VECTOR_IS_MISSING:
'The `vector` or `vectors` property is missing.',
FIELD_TYPE_IS_NOT_SUPPORT: `The data_type is not supported, please use one of ${Object.keys(
DataTypeMap
)
.filter((d: string) => d !== 'None' && d !== 'String')
.join(', ')}.`,
INVALID_PARTITION_NUM: `The partition numbers should between 1 and ${MAX_PARTITIONS_NUMBER}`,
INVALID_PARTITION_KEY_FIELD_TYPE:
'Only non-primary key Int64 or VarChar field support partition key.',
PARTITION_KEY_FIELD_MAXED_OUT: `Only ${MAX_PARTITION_KEY_FIELD_COUNT} field supports partition key. `,
IDS_REQUIRED: 'The `ids` is missing or empty.',
NO_ANNS_FEILD_FOUND_IN_SEARCH: 'Target anns field not found, please check your search parameters.',
FUNCTION_SCHEMA_IS_REQUIRED: 'The `function` property is missing.',
FUNCTION_NAME_IS_REQUIRED: 'The `function_name` property is missing.',
};
export enum ErrorCode {
SUCCESS = 'Success',
IndexNotExist = 'IndexNotExist',
UnexpectedError = 'UnexpectedError',
EmptyCollection = 'EmptyCollection',
UpsertAutoIDTrue = 'UpsertAutoIDTrue',
CollectionNotExists = 'CollectionNotExists',
IllegalArgument = 'IllegalArgument',
RateLimit = 'RateLimit',
SchemaMismatch = 'SchemaMismatch',
}