Skip to content

Update HTTP timeout error messaging #1419

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

Merged
merged 6 commits into from
Apr 3, 2025
Merged

Conversation

camden11
Copy link
Contributor

@camden11 camden11 commented Apr 2, 2025

Description and Context

HTTP timeout errors on the CLI are usually easy to solve by increasing timeout with hs config set, but we don't give users any guidance towards doing that. This adds a helpful message for all timeout errors that are triggered by the default timeout.

Relies on this LDL PR: https://github.com/HubSpot/hubspot-local-dev-lib
Issue: https://git.hubteam.com/HubSpot/hubspot-cli-issues/issues/803

Screenshots

Before (unhelpful)
Screenshot 2025-04-02 at 2 44 36 PM

After (helpful)
Screenshot 2025-04-02 at 2 44 24 PM

Who to Notify

@brandenrodgers @joe-yeager @kemmerle

const config = getConfig();
const defaultTimeout = config?.httpTimeout;

if (error.timeout && defaultTimeout === error.timeout) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Checking this to make sure the message doesn't get displayed in cases where we explicitly set a timeout

Copy link
Contributor

Choose a reason for hiding this comment

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

Should we still have some sort of error override, even if we manually adjusted the timeout?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question, I was thinking we'd just handle that on a case by case basis anywhere where we suspect it could be an issue (which is few or zero places as far as i know)

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah I see what you mean. My guess is that it would be fine to open this up to apply to all timeouts, but what you have is an improvement regardless. You can make the call to keep or remove the extra check

Copy link
Contributor Author

@camden11 camden11 Apr 2, 2025

Choose a reason for hiding this comment

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

Ohh I was just trying to avoid the case where we manually set a timeout somewhere and then a user tries to fix an error with hs config set but it doesn't work. I'll add a generic message for when that's the case

Copy link
Contributor

Choose a reason for hiding this comment

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

I didn't think about that. Then yeah +1 to keeping this in 👌

Copy link
Contributor

Choose a reason for hiding this comment

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

Might be worth adding a comment so we don't forget that years from now lol

brandenrodgers
brandenrodgers previously approved these changes Apr 2, 2025
Copy link
Contributor

@brandenrodgers brandenrodgers left a comment

Choose a reason for hiding this comment

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

Just one question about how we handle the error in cases where we adjusted the timeout, but it's not blocking. This lgtm 👌

@camden11 camden11 merged commit 74a7484 into main Apr 3, 2025
1 check passed
@camden11 camden11 deleted the improve-timeout-error-messaging branch April 3, 2025 15:02
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.

2 participants