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

Update the error message when you run out of workspace credits. #9370

Merged
merged 3 commits into from
Apr 27, 2022

Conversation

Harry-Hopkinson
Copy link
Contributor

Description

Before the error message was very vague when one ran out of workspace hours. With this change it makes the error message clearer for the user.

Changes

Not enough credits. Please book more.

To

Not enough monthly workspace hours. Please upgrade your account to get more hours for your workspaces.

@andrew-farries
Copy link
Contributor

andrew-farries commented Apr 20, 2022

Thanks for contributing, @Harry-Hopkinson 🧡

The changes look good.

You'll also need to sign a Contributor License Agreement (CLA)[1] once before merging your first contribution. Looping in @meysholdt to reach out about the CLA. 🏓

@andrew-farries
Copy link
Contributor

/hold

@andrew-farries
Copy link
Contributor

andrew-farries commented Apr 20, 2022

/werft run

👍 started the job as gitpod-build-main-fork.27

@andrew-farries
Copy link
Contributor

/release-note-none

@andrew-farries
Copy link
Contributor

Rebasing this against upstream main should fix the build error.

@geropl geropl added the team: webapp Issue belongs to the WebApp team label Apr 21, 2022
@csweichel
Copy link
Contributor

csweichel commented Apr 22, 2022

/werft run

👍 started the job as gitpod-build-main-fork.28

@jankeromnes
Copy link
Contributor

jankeromnes commented Apr 22, 2022

Hi @Harry-Hopkinson, many thanks for improving this error message! Your proposed new phrasing looks much better to me as well. 🎯

Also, thank you @andrew-farries for reviewing this excellent community contribution, and pushing it through the various hurdles! 🙏


Adding just a bit more context here in case you're interested:

When you create a new workspace, the error NOT_ENOUGH_CREDIT has special handling that shows a nice "Limit Reached" modal with an "Upgrade" button:

case ErrorCodes.NOT_ENOUGH_CREDIT:
// HACK: Hide the error (behind the modal)
error = undefined;
phase = StartPhase.Stopped;
statusMessage = <LimitReachedOutOfHours />;

<LimitReachedModal>
<p className="mt-1 mb-2 text-base dark:text-gray-400">
You have reached the limit of monthly workspace hours for your account. Please upgrade to get more hours
for your workspaces.
</p>
</LimitReachedModal>

Unfortunately, we don't handle it the same way when starting an existing workspace: we simply pass the error along to <StartPage> which then displays it as is without much handling:

<StartPage phase={phase} error={error} title={title} showLatestIdeWarning={useLatest}>
{statusMessage}
</StartPage>

function StartError(props: { error: StartWorkspaceError }) {
const { error } = props;
if (!error) {
return null;
}
return <p className="text-base text-gitpod-red w-96">{error.message}</p>;
}

In the future, I think it could be nice to centralize error handling between CreateWorkspace.tsx and StartWorkspace.tsx, so that, for example, a NOT_ENOUGH_CREDIT error would always result in showing the nice "Limit Reached" modal. 💭

But that's definitely a topic for a future Pull Request. 😁 Many thanks again for improving the error message in all the cases where it cannot be handled specifically! 🏀

@meysholdt
Copy link
Member

hi @Harry-Hopkinson, to get the CLA signed, can you please let me know your email address by sending an email to [email protected]? I will then respond with the CLA which you can sign via DocuSign.

@Harry-Hopkinson
Copy link
Contributor Author

Harry-Hopkinson commented Apr 26, 2022

@meysholdt I have sent an email.

@meysholdt meysholdt added cla: accepted ✔️ and removed do-not-merge/cla-pending CLA has not been signed labels Apr 27, 2022
@meysholdt
Copy link
Member

I have received the signed CLA. Thank you, @Harry-Hopkinson.

@andrew-farries
Copy link
Contributor

/unhold

@roboquat roboquat merged commit 32baa1c into gitpod-io:main Apr 27, 2022
@roboquat roboquat added the deployed: webapp Meta team change is running in production label Apr 28, 2022
@roboquat roboquat added the deployed Change is completely running in production label Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: accepted ✔️ community-contribution deployed: webapp Meta team change is running in production deployed Change is completely running in production release-note-none size/XS team: webapp Issue belongs to the WebApp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants