@mintline/mcp 1.1.0 → 1.1.1
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 +8 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -21,9 +21,15 @@ function createClient(apiKey2) {
|
|
|
21
21
|
},
|
|
22
22
|
body: body ? JSON.stringify(body) : void 0
|
|
23
23
|
});
|
|
24
|
-
|
|
24
|
+
let data;
|
|
25
|
+
try {
|
|
26
|
+
data = await res.json();
|
|
27
|
+
} catch {
|
|
28
|
+
throw new Error(`HTTP ${res.status}: ${res.statusText}`);
|
|
29
|
+
}
|
|
25
30
|
if (!data.success) {
|
|
26
|
-
|
|
31
|
+
const errorMsg = data.error?.message || data.message || `Request failed (${res.status})`;
|
|
32
|
+
throw new Error(errorMsg);
|
|
27
33
|
}
|
|
28
34
|
return data;
|
|
29
35
|
}
|