Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

thread api error bodies through HttpError, and use for starter tier quota message #725

Merged
merged 5 commits into from
Feb 8, 2024

Conversation

mythmon
Copy link
Member

@mythmon mythmon commented Feb 8, 2024

Thanks for writing the copy for this, @toph!

Copy link
Contributor

@tophtucker tophtucker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much nicer developer experience than our current error messaging, and much nicer implementation than mine in #698!! But I’m happy I tried it before you so I can review with more context. 😅

src/deploy.ts Outdated
wrapAnsi(`Could not create project: ${error instanceof Error ? error.message : error}`, effects.outputColumns)
);
}
effects.clack.outro(yellow("Deploy cancelled"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have 13 instances of “cancelled” in the create and deploy scripts, but in American English it’s more standard to write “canceled”.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ambiguous double letters are the bane of my spelling life.

Comment on lines +153 to +158
wrapAnsi(
`The Starter tier can only deploy one project. Upgrade to unlimited projects at ${link(
`https://observablehq.com/team/@${deployTarget.workspace.login}/settings`
)}`,
effects.outputColumns - 4
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spiffy wrapping is sorta nice (and works well with clack) but doesn’t feel necessary, especially if we wanna keep dependencies down. Would we do it everywhere?

With wrap-ansi Without wrap-ansi
A3ADB478-1818-4A62-A915-B18EAFE50517-876-000399C415838F5E C5B8D033-3322-45D2-A320-488FF07FEA96-876-000399C66771A7A9

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the idea is to eventually do this everywhere, and both Mike and Visnu recommended wrapAnsi. This is sort of a toe in the water to make sure this approach works in practice. In the future I hope to do it automatically in a Clack wrapper.

@mythmon mythmon merged commit 1ba0da3 into main Feb 8, 2024
2 checks passed
@mythmon mythmon deleted the mythmon/240207/error-codes branch February 8, 2024 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants