@tthr/vue 0.0.62 → 0.0.63
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.
|
@@ -160,8 +160,15 @@ async function executeViaApi(config, functionName, functionType, args) {
|
|
|
160
160
|
body: JSON.stringify({ function: functionName, args }),
|
|
161
161
|
});
|
|
162
162
|
if (!response.ok) {
|
|
163
|
-
const
|
|
164
|
-
|
|
163
|
+
const responseText = await response.text();
|
|
164
|
+
let errorMsg;
|
|
165
|
+
try {
|
|
166
|
+
const error = JSON.parse(responseText);
|
|
167
|
+
errorMsg = error.error || error.message || `Function '${functionName}' failed with status ${response.status}`;
|
|
168
|
+
} catch {
|
|
169
|
+
errorMsg = responseText || `Function '${functionName}' failed with status ${response.status}`;
|
|
170
|
+
}
|
|
171
|
+
log.debug(`/${type} endpoint returned ${response.status}: ${errorMsg}`);
|
|
165
172
|
// If it's a type mismatch error, try the next endpoint
|
|
166
173
|
if (errorMsg.includes('not a') && errorMsg.includes("it's a")) {
|
|
167
174
|
log.debug(`Function type mismatch on /${type}, trying next endpoint...`);
|