CherryHQ/cherry-studio · warning · Error

User denied the Feishu app registration

Error message

User denied the Feishu app registration

What it means

Thrown by registrationPoll() when the poll response carries error='access_denied'. This is the OAuth/device-flow standard error meaning the end user actively rejected the consent/QR authorization in Feishu.

Source

Thrown at src/main/ai/channels/adapters/feishu/FeishuAppRegistration.ts:126

      const userInfo = res.user_info as Record<string, string> | undefined
      logger.info('Feishu app registration succeeded')
      return {
        appId: res.client_id as string,
        appSecret: res.client_secret as string,
        openId: userInfo?.open_id
      }
    }

    // Handle error states
    const error = (res.error as string) ?? ''
    switch (error as PollStatus) {
      case 'authorization_pending':
        continue
      case 'slow_down':
        interval += 5000
        continue
      case 'access_denied':
        throw new Error('User denied the Feishu app registration')
      case 'expired_token':
        throw new Error('Feishu app registration QR code expired')
      default:
        if (error) {
          throw new Error(`Feishu registration poll error: ${error}`)
        }
        continue
    }
  }

  throw new Error('Feishu app registration timed out')
}

View on GitHub (pinned to 726446b54c)

Solutions

  1. Surface a clear 'authorization denied by user' message and offer to restart the flow.
  2. Do not auto-retry — retrying immediately will just re-prompt; let the user re-initiate.
  3. Pre-explain required scopes on the QR screen so users don't deny.
Defensive patterns

Strategy: try-catch

Validate before calling

// No pre-call validation: access_denied is a user runtime decision.
// Defense is to handle it gracefully post-event.

Type guard

function isFeishuUserDenied(e: unknown): e is Error {
  return e instanceof Error && e.message === 'User denied the Feishu app registration'
}

Try / catch

try {
  await registrationPoll(domain, deviceCode, opts)
} catch (e) {
  if (isFeishuUserDenied(e)) { notifyUser('You denied the Feishu authorization. Restart to try again.'); return }
  throw e
}

Prevention

When it happens

Trigger: User scans the QR in Feishu then taps 'deny'/'cancel' on the consent screen; the next poll returns {error:'access_denied'} and the switch throws.

Common situations: User changed their mind, selected the wrong account, or the consent screen warned about scopes they declined.

Related errors


AI-assisted analysis of CherryHQ/cherry-studio@726446b54c (2026-08-12). Data as JSON: /api/errors/a7e788c1a1a343a4. Report an issue: GitHub.