Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
Signed-off-by: ruiyi.jiang <[email protected]>
  • Loading branch information
shanghaikid committed Oct 9, 2023
1 parent 435df3f commit 6978cd7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion milvus/grpc/Data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export class Data extends Collection {
});

if (collectionInfo.status.error_code !== ErrorCode.SUCCESS) {
throw new Error(collectionInfo.status.reason);
throw collectionInfo;
}

// Tip: The field data sequence needs to be set same as `collectionInfo.schema.fields`.
Expand Down
7 changes: 2 additions & 5 deletions test/Insert.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,7 @@ describe(`Insert API`, () => {
fields_data: [{}],
});
} catch (error) {
expect(error.message).toEqual(
`Invalid collection name: ${errorName}. collection name can only contain numbers, letters and underscores`
);
expect(error.status === ErrorCode.Illegal_Argument);
}
});

Expand Down Expand Up @@ -177,7 +175,6 @@ describe(`Insert API`, () => {
};

const res = await milvusClient.insert(params);
console.log('xx', res);
expect(res.status.error_code).toEqual(ErrorCode.SUCCESS);
});

Expand Down Expand Up @@ -426,7 +423,7 @@ describe(`Insert API`, () => {
});
expect('a').toEqual('b');
} catch (error) {
expect(error.message).toBe('error');
expect(error.status.reason).toBe('error');
} finally {
fakeClient.closeConnection();
}
Expand Down
6 changes: 2 additions & 4 deletions test/Upsert.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,7 @@ describe(`Upsert API`, () => {
fields_data: [{}],
});
} catch (error) {
expect(error.message).toEqual(
`Invalid collection name: ${errorName}. collection name can only contain numbers, letters and underscores`
);
expect(error.status === ErrorCode.Illegal_Argument);
}
});

Expand Down Expand Up @@ -416,7 +414,7 @@ describe(`Upsert API`, () => {
});
expect('a').toEqual('b');
} catch (error) {
expect(error.message).toBe('error');
expect(error.status.reason).toBe('error');
} finally {
fakeClient.closeConnection();
}
Expand Down

0 comments on commit 6978cd7

Please sign in to comment.