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

chore: Update CLI to utilize new error object. #1109

Merged
merged 9 commits into from
Aug 6, 2024

Conversation

joe-yeager
Copy link
Contributor

@joe-yeager joe-yeager commented Jun 24, 2024

Description and Context

Depends on HubSpot/hubspot-local-dev-lib#159

  • Update the CLI to use the new util methods and error object
  • Simplify the logging down to a single method

Who to Notify

@brandenrodgers @camden11 @kemmerle

@joe-yeager joe-yeager marked this pull request as ready for review July 15, 2024 18:29
Copy link
Contributor

@camden11 camden11 left a comment

Choose a reason for hiding this comment

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

Looks like this still needs a LDL version bump, but otherwise LGTM

@joe-yeager joe-yeager changed the base branch from main to next July 17, 2024 19:52
@joe-yeager joe-yeager marked this pull request as draft July 23, 2024 16:49
@joe-yeager
Copy link
Contributor Author

I bumped this back to a draft. I'm going to update this to use all of the changes from the final LDL refactor PR over here


const i18nKey = 'lib.errorHandlers.index';

function logError(error, context = {}) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is now the singular logError method that will handle the logging. So we can call this and let it determine how to log the output.

}

if (isHubSpotHttpError(error) || isFileSystemError(error)) {
logger.error(error.toString());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The HubSpotHttpError class has a toString method that returns a friendly string representation of the contents.

I am add a similar method for the FileSystemError class so this method can be naive about how to format the messages for that class.

@joe-yeager joe-yeager marked this pull request as ready for review August 5, 2024 16:31
@joe-yeager joe-yeager merged commit b8edb57 into next Aug 6, 2024
1 check failed
@joe-yeager joe-yeager deleted the jy/integrate-new-http-error-object branch August 6, 2024 17:11
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.

4 participants