cli icon indicating copy to clipboard operation
cli copied to clipboard

fix: updated error message for attempting to deploy a site with a badโ€ฆ

Open dylanspyer opened this issue 1 year ago โ€ข 2 comments

๐ŸŽ‰ 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 avatar Oct 17 '24 20:10 dylanspyer

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?

khendrikse avatar Oct 18 '24 11:10 khendrikse

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

dylanspyer avatar Oct 18 '24 16:10 dylanspyer