mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
refactor(Google Sheets Node): Prevent reporting to Sentry failure to find spreadsheet (no-changelog) (#7518)
To silence this very frequently reported error: https://n8nio.sentry.io/issues/3823103947/?project=4503924908883968&query=&referrer=issue-stream&statsPeriod=90d&stream_index=0
This commit is contained in:
@@ -4,6 +4,7 @@ import type {
|
||||
INodeExecutionData,
|
||||
INodeListSearchItems,
|
||||
INodePropertyOptions,
|
||||
INode,
|
||||
} from 'n8n-workflow';
|
||||
import { NodeOperationError } from 'n8n-workflow';
|
||||
import type { GoogleSheet } from './GoogleSheet';
|
||||
@@ -18,10 +19,16 @@ import { ResourceLocatorUiNames, ROW_NUMBER } from './GoogleSheets.types';
|
||||
export const untilSheetSelected = { sheetName: [''] };
|
||||
|
||||
// Used to extract the ID from the URL
|
||||
export function getSpreadsheetId(documentIdType: ResourceLocator, value: string): string {
|
||||
export function getSpreadsheetId(
|
||||
node: INode,
|
||||
documentIdType: ResourceLocator,
|
||||
value: string,
|
||||
): string {
|
||||
if (!value) {
|
||||
throw new Error(
|
||||
throw new NodeOperationError(
|
||||
node,
|
||||
`Can not get sheet '${ResourceLocatorUiNames[documentIdType]}' with a value of '${value}'`,
|
||||
{ severity: 'warning' },
|
||||
);
|
||||
}
|
||||
if (documentIdType === 'url') {
|
||||
|
||||
Reference in New Issue
Block a user