fix(Microsoft SQL Node): Handle connection errors correctly with continueOnFail (#15962)

This commit is contained in:
Elias Meire
2025-06-04 13:58:17 +02:00
committed by GitHub
parent 30d75db9e3
commit 4c9198df37
2 changed files with 98 additions and 4 deletions

View File

@@ -247,13 +247,24 @@ export class MicrosoftSql implements INodeType {
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
const credentials = await this.getCredentials('microsoftSql');
const pool = configurePool(credentials);
await pool.connect();
let responseData: IDataObject | IDataObject[] = [];
let returnData: INodeExecutionData[] = [];
const items = this.getInputData();
const pairedItem = generatePairedItemData(items.length);
const pool = configurePool(credentials);
try {
await pool.connect();
} catch (error) {
void pool.close();
if (this.continueOnFail()) {
return [[{ json: { error: error.message }, pairedItem }]];
} else {
throw error;
}
}
const operation = this.getNodeParameter('operation', 0);
const nodeVersion = this.getNode().typeVersion;