Error.ts 228 B

12345678910
  1. import {
  2. ErrorCode,
  3. ResStatus,
  4. } from '@zilliz/milvus2-sdk-node/dist/milvus/types/Response';
  5. export const throwErrorFromSDK = (res: ResStatus) => {
  6. if (res.error_code !== ErrorCode.SUCCESS) {
  7. throw res.reason;
  8. }
  9. };