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

fix: updated error message for attempting to deploy a site with a bad… #6884

Merged
merged 8 commits into from
Oct 25, 2024

Conversation

dylanspyer
Copy link
Contributor

🎉 Thanks for submitting a pull request! 🎉

Summary

Fixes: 6736

Previously, netlify deploy with a valid site ID and an invalid auth token would log Error: Site not found. Please rerun "netlify link". Updated this error message to be more clear by logging the message property from the API response when the response status is 401.

Before:
image

After:
image


For us to review and ship your PR efficiently, please perform the following steps:

  • Open a bug/issue before writing your code 🧑‍💻. This ensures we can discuss the changes and get feedback from everyone that should be involved. If you`re fixing a typo or something that`s on fire 🔥 (e.g. incident related), you can skip this step.
  • Read the contribution guidelines 📖. This ensures your code follows our style guide and
    passes our tests.
  • Update or add tests (if any source code was changed or added) 🧪
  • Update or add documentation (if features were changed or added) 📝
  • Make sure the status checks below are successful ✅

A picture of a cute animal (not mandatory, but encouraged)
image

@dylanspyer dylanspyer requested a review from a team as a code owner October 17, 2024 20:56
@khendrikse
Copy link
Contributor

Hi @dylanspyer! Thank you so much for your contribution :) could you maybe still log 'site not found' but also render the error message? I think this could inform our users better on what part of the process went wrong and why?

@dylanspyer
Copy link
Contributor Author

Hi @dylanspyer! Thank you so much for your contribution :) could you maybe still log 'site not found' but also render the error message? I think this could inform our users better on what part of the process went wrong and why?

Thanks for the feedback! I pushed an update with a clearer error message:
image

In this failure case, it's possible that the site id is valid and the auth token is invalid. Logging site not found in that case might be misleading. Let me know your thoughts :) @khendrikse

Copy link
Contributor

@DanielSLew DanielSLew left a comment

Choose a reason for hiding this comment

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

This looks good to me! Just have a request to remove those type errors.

src/utils/get-site.ts Outdated Show resolved Hide resolved
@dylanspyer dylanspyer requested a review from a team as a code owner October 24, 2024 21:50
@DanielSLew DanielSLew enabled auto-merge (squash) October 25, 2024 19:14
@DanielSLew DanielSLew merged commit 9cb44c5 into netlify:main Oct 25, 2024
48 checks passed
@dylanspyer dylanspyer deleted the oct-17 branch October 25, 2024 20:40
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.

Misleading error message when an invalid NETLIFY_AUTH_TOKEN is provided
3 participants