joeyespo / grip

Preview GitHub README.md files locally before committing them.
MIT License
6.48k stars 424 forks source link

Exit on API errors #270

Open codeindulgence opened 6 years ago

codeindulgence commented 6 years ago

When the Github API returns an error, the command should exit and print the error to stderr instead of rendering a HTML page.

Maybe this only applies to --export mode, and not the normal live-reload mode.

Scenario: We've been happily using grip to render some documentation when a commit it pushed to our repo. One day we had users reporting that the usual documentation had been replaced with the "Rate Limit" error page.

Ideally what would have happened is that the build step which generates the HTML simply threw an error, instead of overwriting the existing documentation with the error page, which went completely unnoticed until someone tried to view it.

Passing through the error from Github would also be useful in situations as described in #258

Cheers!

joeyespo commented 6 years ago

Oh yeah, that makes a lot of sense.

+1 from me. I'll get on this and make the errors more accurate for #258 by the next release.

Thanks for writing this up! Very clear that this is a real problem.