-
Notifications
You must be signed in to change notification settings - Fork 64
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
Conversation
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.
Looks like this still needs a LDL version bump, but otherwise LGTM
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 = {}) { |
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.
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()); |
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.
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.
…te-new-http-error-object
Description and Context
Depends on HubSpot/hubspot-local-dev-lib#159
Who to Notify
@brandenrodgers @camden11 @kemmerle