-
Notifications
You must be signed in to change notification settings - Fork 63
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
Sandbox error handling updates #990
Merged
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
c9672db
Use LDL utils, add error scenario for sandbox create
678eb18
Delete util updates
8b64b6b
Revert delete changes
b1d3bd5
Sandbox sync replace util with LDL versions
42b756a
Update isMissingScopeError usage
b35bdca
Add migration comments
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ const { | |
const { | ||
isMissingScopeError, | ||
isSpecifiedError, | ||
} = require('./errorHandlers/apiErrors'); | ||
} = require('@hubspot/local-dev-lib/errors/apiErrors'); | ||
const { getHubSpotWebsiteOrigin } = require('@hubspot/local-dev-lib/urls'); | ||
const { getEnv, getAccountId } = require('@hubspot/local-dev-lib/config'); | ||
const { createSandbox } = require('@hubspot/local-dev-lib/sandboxes'); | ||
|
@@ -101,6 +101,22 @@ const buildSandbox = async ({ | |
}) | ||
); | ||
logger.log(''); | ||
} else if ( | ||
isSpecifiedError(err, { | ||
statusCode: 403, | ||
category: 'BANNED', | ||
subCategory: 'SandboxErrors.DEVELOPMENT_SANDBOX_ACCESS_NOT_ALLOWED', | ||
Comment on lines
+105
to
+108
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added a gating error scenario for when users are not ungated for crm-developement-beta |
||
}) | ||
) { | ||
logger.log(''); | ||
logger.error( | ||
i18n(`${i18nKey}.failure.403Gating`, { | ||
accountName: name, | ||
parentAccountName: accountConfig.name || accountId, | ||
accountId, | ||
}) | ||
); | ||
logger.log(''); | ||
} else if ( | ||
isSpecifiedError(err, { | ||
statusCode: 400, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I migrated over
isMissingScopeError
to the LDL version since its for a sandboxes endpoint, but leftisSpecifiedError
as the local version. The usage ofisSpecifiedError
in this file is forhandleProjectUpload
which is still pullinguploadProject
from the old@hubspot/cli-lib
dependency where the http base is still request-promise-native.Same goes for
cli -> lib -> projects.js
in this repo sincefetchProject
is also pulled in from@hubspot/cli-lib
. Usage is limited to just those two in projects files - I'll leave a comment in the code to reduce any confusion once that migration happens