@saidulbadhon/jssm-cli 1.6.3 → 1.6.5
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/index.js +12 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4143,10 +4143,19 @@ async function apiRequest(url, authToken, options = {}) {
|
|
|
4143
4143
|
headers
|
|
4144
4144
|
});
|
|
4145
4145
|
if (!response.ok) {
|
|
4146
|
-
const
|
|
4146
|
+
const errorBody = await response.json().catch(() => ({
|
|
4147
4147
|
error: `HTTP ${response.status} ${response.statusText}`
|
|
4148
4148
|
}));
|
|
4149
|
-
|
|
4149
|
+
let message;
|
|
4150
|
+
if (typeof errorBody.error === "string") {
|
|
4151
|
+
message = errorBody.error;
|
|
4152
|
+
} else if (typeof errorBody.error === "object" && errorBody.error !== null && "message" in errorBody.error && typeof errorBody.error.message === "string") {
|
|
4153
|
+
message = errorBody.error.message;
|
|
4154
|
+
} else if (typeof errorBody.message === "string") {
|
|
4155
|
+
message = errorBody.message;
|
|
4156
|
+
} else if (errorBody.error) {
|
|
4157
|
+
message = JSON.stringify(errorBody.error);
|
|
4158
|
+
}
|
|
4150
4159
|
throw new Error(
|
|
4151
4160
|
message || `HTTP ${response.status} ${response.statusText}`
|
|
4152
4161
|
);
|
|
@@ -5826,7 +5835,7 @@ ${import_chalk.default.bold("Usage in Docker:")}
|
|
|
5826
5835
|
|
|
5827
5836
|
// src/utils/versionCheck.ts
|
|
5828
5837
|
var PACKAGE_NAME = "@saidulbadhon/jssm-cli";
|
|
5829
|
-
var CURRENT_VERSION = "1.6.
|
|
5838
|
+
var CURRENT_VERSION = "1.6.5";
|
|
5830
5839
|
async function getLatestVersion() {
|
|
5831
5840
|
try {
|
|
5832
5841
|
const response = await fetch(`https://registry.npmjs.org/${PACKAGE_NAME}`);
|