fix(X (Twitter) Node): Surface API error message for insufficient access level (#27603)

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Shireen Missi <94372015+ShireenMissi@users.noreply.github.com>
This commit is contained in:
Jon 2026-04-01 11:53:17 +01:00 committed by GitHub
parent daf233f24e
commit 5fdb18b5f9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -47,7 +47,8 @@ export async function twitterApiRequest(
if (error.error?.required_enrollment === 'Appropriate Level of API Access') {
throw new NodeOperationError(
this.getNode(),
'The operation requires Twitter Api to be either Basic or Pro.',
(error.error.detail as string) ??
'This operation requires a higher level of X (Twitter) API access. Please check your subscription at developer.twitter.com.',
);
} else if (error.errors && error.error?.errors[0].message.includes('must be ')) {
throw new NodeOperationError(this.getNode(), error.error.errors[0].message as string);