fix(Notion Node): Use UserError for an unmatched database-mention regex

The resource-locator value comes from the user or an expression, so a
failed extraction is a user error, not an unexpected one.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Emilia 2026-09-24 11:35:08 +01:00
parent 3294b22da3
commit 3218d0ea37
No known key found for this signature in database
GPG Key ID: 837988349B71DD1A

View File

@ -24,7 +24,7 @@ import {
NodeOperationError,
safeInternalRegex,
setSafeObjectProperty,
UnexpectedError,
UserError,
} from 'n8n-workflow';
import { validate as uuidValidate } from 'uuid';
@ -1123,7 +1123,7 @@ export function extractDatabaseMentionRLC(blockValues: IDataObject[]) {
const extracted = safeInternalRegex.exec(txt.database.__regex, txt.database.value);
const databaseId = extracted?.[1];
if (databaseId === undefined) {
throw new UnexpectedError(
throw new UserError(
`Could not extract the database ID from "${txt.database.value}"`,
);
}