Skip to content

Commit

Permalink
Add new error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
camden11 committed Jan 14, 2025
1 parent 88b54cb commit eff583a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
3 changes: 3 additions & 0 deletions lang/en.lyaml
Original file line number Diff line number Diff line change
Expand Up @@ -1075,6 +1075,7 @@ en:
fileChangeError: "Failed to notify local dev server of file change: {{ message }}"
localDev:
confirmDefaultAccountIsTarget:
configError: "An error occurred while reading the default account from your config. Run {{ authCommand }} to re-auth this account"
declineDefaultAccountExplanation: "To develop on a different account, run {{ useCommand }} to change your default account, then re-run {{ devCommand }}."
checkIfDefaultAccountIsSupported:
publicApp: "This project contains a public app. Local development of public apps is only supported on developer accounts and developer test accounts. Change your default account using {{ useCommand }}, or link a new account with {{ authCommand }}."
Expand All @@ -1095,6 +1096,7 @@ en:
createInitialBuildForNewProject:
initialUploadMessage: "HubSpot Local Dev Server Startup"
projectLockedError: "Your project is locked. This may mean that another user is running the {{#bold}}`hs project watch`{{/bold}} command for this project. If this is you, unlock the project in Projects UI."
genericError: "An error occurred while creating the initial build for this project. Run {{ uploadCommand }} to try again."
checkIfParentAccountIsAuthed:
notAuthedError: "To develop this project locally, run {{ authCommand }} to authenticate the App Developer Account {{ accountId }} associated with {{ accountIdentifier }}."
projects:
Expand Down Expand Up @@ -1421,6 +1423,7 @@ en:
invalidUser: "Couldn't create {{#bold}}{{ accountName }}{{/bold}} because your account has been removed from {{#bold}}{{ parentAccountName }}{{/bold}} or your permission set doesn't allow you to create the sandbox. To update your permissions, contact a super admin in {{#bold}}{{ parentAccountName }}{{/bold}}."
403Gating: "Couldn't create {{#bold}}{{ accountName }}{{/bold}} because {{#bold}}{{ parentAccountName }}{{/bold}} does not have access to development sandboxes. To opt in to the CRM Development Beta and use development sandboxes, visit https://app.hubspot.com/l/product-updates/in-beta?update=13899236."
usageLimitsFetch: "Unable to fetch sandbox usage limits. Please try again."
generic: "An error occurred while creating a new sandbox. Please try again."
limit:
developer:
one: "{{#bold}}{{ accountName }}{{/bold}} reached the limit of {{ limit }} development sandbox.
Expand Down
16 changes: 13 additions & 3 deletions lib/localDev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,12 @@ export async function confirmDefaultAccountIsTarget(
accountConfig: CLIAccount
): Promise<void> {
if (!accountConfig.name || !accountConfig.accountType) {
throw new Error('TODO');
logger.error(
i18n(`${i18nKey}.confirmDefaultAccountIsTarget.configError`, {
authCommand: uiCommandReference('hs auth'),
})
);
process.exit(EXIT_CODES.ERROR);
}

logger.log();
Expand Down Expand Up @@ -245,7 +250,7 @@ export async function createSandboxForLocalDev(
const sandboxAccountConfig = getAccountConfig(result.sandbox.sandboxHubId);

if (!sandboxAccountConfig) {
logger.error('TODO');
logger.error(i18n('lib.sandbox.create.failure.generic'));
process.exit(EXIT_CODES.ERROR);
}

Expand Down Expand Up @@ -443,7 +448,12 @@ function projectUploadCallback(
buildId?: number
): Promise<ProjectPollResult> {
if (!buildId) {
throw new Error('TODO');
logger.error(
i18n(`${i18nKey}.createInitialBuildForNewProject.initialUploadMessage`, {
uploadCommand: uiCommandReference('hs project upload'),
})
);
process.exit(EXIT_CODES.ERROR);
}

return pollProjectBuildAndDeploy(
Expand Down

0 comments on commit eff583a

Please sign in to comment.