n8n-nodes-github-copilot 3.31.28 → 3.31.29
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.
|
@@ -242,34 +242,82 @@ class GitHubCopilotOpenAI {
|
|
|
242
242
|
catch (error) {
|
|
243
243
|
if (this.continueOnFail()) {
|
|
244
244
|
const errorMessage = error instanceof Error ? error.message : "Unknown error";
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
245
|
+
const errorString = JSON.stringify(error);
|
|
246
|
+
console.error('❌ Error occurred:', errorMessage);
|
|
247
|
+
console.error('❌ Error details:', errorString);
|
|
248
|
+
let apiError = null;
|
|
249
|
+
try {
|
|
250
|
+
if (error && typeof error === 'object' && 'cause' in error) {
|
|
251
|
+
const cause = error.cause;
|
|
252
|
+
if (cause && cause.error) {
|
|
253
|
+
apiError = cause.error;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
if (!apiError && errorString.includes('{') && errorString.includes('}')) {
|
|
257
|
+
const jsonMatch = errorString.match(/\{[^{}]*"error"[^{}]*\}/);
|
|
258
|
+
if (jsonMatch) {
|
|
259
|
+
apiError = JSON.parse(jsonMatch[0]);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
254
262
|
}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
errorCode = "invalid_request";
|
|
263
|
+
catch (parseError) {
|
|
264
|
+
console.error('Failed to parse API error:', parseError);
|
|
258
265
|
}
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
266
|
+
let errorType = "invalid_request_error";
|
|
267
|
+
let errorCode = null;
|
|
268
|
+
let errorParam = null;
|
|
269
|
+
let finalMessage = errorMessage;
|
|
270
|
+
if (apiError && apiError.error) {
|
|
271
|
+
finalMessage = apiError.error.message || errorMessage;
|
|
272
|
+
errorType = apiError.error.type || errorType;
|
|
273
|
+
errorCode = apiError.error.code || null;
|
|
274
|
+
errorParam = apiError.error.param || null;
|
|
275
|
+
console.log('✅ Using GitHub Copilot API error details');
|
|
262
276
|
}
|
|
263
277
|
else {
|
|
264
|
-
|
|
265
|
-
|
|
278
|
+
if (errorMessage.includes("max") && errorMessage.includes("token")) {
|
|
279
|
+
errorType = "invalid_request_error";
|
|
280
|
+
errorCode = "context_length_exceeded";
|
|
281
|
+
errorParam = "max_tokens";
|
|
282
|
+
}
|
|
283
|
+
else if (errorMessage.includes("403") || errorMessage.includes("Forbidden")) {
|
|
284
|
+
errorType = "invalid_request_error";
|
|
285
|
+
errorCode = "insufficient_quota";
|
|
286
|
+
}
|
|
287
|
+
else if (errorMessage.includes("401") || errorMessage.includes("Unauthorized")) {
|
|
288
|
+
errorType = "invalid_request_error";
|
|
289
|
+
errorCode = "invalid_api_key";
|
|
290
|
+
}
|
|
291
|
+
else if (errorMessage.includes("400") || errorMessage.includes("Bad Request")) {
|
|
292
|
+
errorType = "invalid_request_error";
|
|
293
|
+
errorCode = "invalid_request";
|
|
294
|
+
}
|
|
295
|
+
else if (errorMessage.includes("429") || errorMessage.includes("rate limit")) {
|
|
296
|
+
errorType = "rate_limit_error";
|
|
297
|
+
errorCode = "rate_limit_exceeded";
|
|
298
|
+
}
|
|
299
|
+
else if (errorMessage.includes("timeout")) {
|
|
300
|
+
errorType = "api_error";
|
|
301
|
+
errorCode = "timeout";
|
|
302
|
+
}
|
|
303
|
+
else {
|
|
304
|
+
errorType = "api_error";
|
|
305
|
+
errorCode = "internal_error";
|
|
306
|
+
}
|
|
307
|
+
console.log('⚠️ Using fallback error detection');
|
|
266
308
|
}
|
|
309
|
+
console.log('📋 Final error format:', {
|
|
310
|
+
message: finalMessage,
|
|
311
|
+
type: errorType,
|
|
312
|
+
param: errorParam,
|
|
313
|
+
code: errorCode,
|
|
314
|
+
});
|
|
267
315
|
returnData.push({
|
|
268
316
|
json: {
|
|
269
317
|
error: {
|
|
270
|
-
message:
|
|
318
|
+
message: finalMessage,
|
|
271
319
|
type: errorType,
|
|
272
|
-
param:
|
|
320
|
+
param: errorParam,
|
|
273
321
|
code: errorCode,
|
|
274
322
|
},
|
|
275
323
|
},
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-github-copilot",
|
|
3
|
-
"version": "3.31.
|
|
3
|
+
"version": "3.31.29",
|
|
4
4
|
"description": "n8n community node for GitHub Copilot with CLI integration, Chat API access, and AI Chat Model for workflows - access GPT-5, Claude, Gemini and more using your Copilot subscription",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/sufficit/n8n-nodes-github-copilot",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "n8n-nodes-github-copilot",
|
|
3
|
-
"version": "3.31.
|
|
3
|
+
"version": "3.31.29",
|
|
4
4
|
"description": "n8n community node for GitHub Copilot with CLI integration, Chat API access, and AI Chat Model for workflows - access GPT-5, Claude, Gemini and more using your Copilot subscription",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/sufficit/n8n-nodes-github-copilot",
|