@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.
- package/dist/client.js +2 -12
- 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
|
-
|
|
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
|
-
|
|
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