@moxn/kb-migrate 0.4.36 → 0.4.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/client.js +2 -12
  2. package/package.json +1 -1
package/dist/client.js CHANGED
@@ -395,12 +395,7 @@ export class MoxnClient {
395
395
  error.branchId = body.branchId;
396
396
  throw error;
397
397
  }
398
- const message = body.details
399
- ? `API error ${response.status}: ${body.details}`
400
- : body.error
401
- ? `API error ${response.status}: ${body.error}`
402
- : `API error: ${response.status}`;
403
- throw new Error(message);
398
+ throw new Error(formatApiError(response.status, body));
404
399
  }
405
400
  return response.json();
406
401
  }
@@ -415,12 +410,7 @@ export class MoxnClient {
415
410
  });
416
411
  if (!response.ok) {
417
412
  const body = await response.json().catch(() => ({}));
418
- const message = body.details
419
- ? `API error ${response.status}: ${body.details}`
420
- : body.error
421
- ? `API error ${response.status}: ${body.error}`
422
- : `API error: ${response.status}`;
423
- throw new Error(message);
413
+ throw new Error(formatApiError(response.status, body));
424
414
  }
425
415
  return response.json();
426
416
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moxn/kb-migrate",
3
- "version": "0.4.36",
3
+ "version": "0.4.37",
4
4
  "description": "Migration tool for importing documents into Moxn Knowledge Base from local files, Notion, Google Docs, and more",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",