mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 02:51:14 +00:00
fix(core): Ensure error.message is a string before checking for specific messages (#17417)
This commit is contained in:
@@ -206,7 +206,7 @@ export async function generateCodeForAiTransform(prompt: string, path: string, r
|
||||
code = generatedCode;
|
||||
break;
|
||||
} catch (e) {
|
||||
if (e.message.includes('maximum context length')) {
|
||||
if (typeof e.message === 'string' && e.message.includes('maximum context length')) {
|
||||
reducePayloadSizeOrThrow(payload, e);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -93,7 +93,11 @@ export const useWorkflowHistoryStore = defineStore('workflowHistory', () => {
|
||||
return await workflowsStore
|
||||
.updateWorkflow(workflowId, updateData, true)
|
||||
.catch(async (error) => {
|
||||
if (error.httpStatusCode === 400 && error.message.includes('can not be activated')) {
|
||||
if (
|
||||
error.httpStatusCode === 400 &&
|
||||
typeof error.message === 'string' &&
|
||||
error.message.includes('can not be activated')
|
||||
) {
|
||||
return await workflowsStore.fetchWorkflow(workflowId);
|
||||
} else {
|
||||
throw new Error(error);
|
||||
|
||||
Reference in New Issue
Block a user