collab: Improve error message when requesting an LLM token without a subscription (#30405)

This PR improves the error message when trying to obtain an LLM token
without a subscription:

<img width="411" alt="Screenshot 2025-05-09 at 12 30 41 PM"
src="https://github.com/user-attachments/assets/c53326ba-4a99-4d9c-88ba-674e520f941f"
/>

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2025-05-09 12:51:41 -04:00 committed by GitHub
parent 00292450e0
commit cf8f003916
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -66,7 +66,7 @@ impl LlmTokenClaims {
let subscription_period =
billing_subscription::Model::current_period(subscription, is_staff)
.map(|(start, end)| (start.naive_utc(), end.naive_utc()))
.ok_or_else(|| anyhow!("missing subscription period"))?;
.ok_or_else(|| anyhow!("A plan is required to use Zed's hosted models or edit predictions. Visit https://zed.dev/account to get started."))?;
let now = Utc::now();
let claims = Self {