Skip to content
This repository has been archived by the owner on Sep 14, 2019. It is now read-only.

Better error messaging for missing PEM && env vars #7

Closed
JasonEtco opened this issue Sep 22, 2017 · 5 comments
Closed

Better error messaging for missing PEM && env vars #7

JasonEtco opened this issue Sep 22, 2017 · 5 comments
Labels
➡️ Tracking Issue is being tracked in a related Issue or PR 🤖 Probot Core Feedback related to core Probot features wontfix

Comments

@JasonEtco
Copy link
Member

Per a discussion going on in the Slack channel right here, a user was having a hard time debugging and getting their App going but had no idea why. The error messages being returned weren't too helpful. Turns out, they had forgotten to copy the .pem certificate file over to the App's directory. Let's improve the error messaging there (and maybe around other env variables missing)! Could just do something simple like:

const requiredEnvVariables = ['APP_ID', 'OTHER_THING'];
const missingEnvVariables = requiredEnvVariables.filter((v) => Boolean(process.env[v]);

missingEnvVariables.forEach((variable) => {
  console.error(`You are missing the ${variable} environment variable!`);
});

cc @anglinb who helped the dev debug this 🙌

@anglinb
Copy link

anglinb commented Sep 22, 2017

Thanks for opening this up @JasonEtco! This super concise and I think would help folks out a bunch when they're getting started. 👍 Could even link to setup docs. I really like how FB does this sort of thing for React Native. If something is broken, they point you to an issue on GitHub that has multiple solutions from the community. I think this is easier to point to docs b/c the "problem" the developer is facing should be easier to fix and it's not a "it could be x, y, or z" type issue where pointing to issues is most helpful.

@bkeepers
Copy link
Contributor

Yes, love it!

It'd also be nice to rescue this error with a more friendly error. Something like: It looks like your private key is not valid. See https//probot.github.io/docs/errors/#invalid-private-key to debug it. OpenSSL says: error:0906D06C:PEM routines:PEM_read_bio:no start

@JasonEtco
Copy link
Member Author

I'd like to open this one up as a hacktoberfest issue; shall I make a new one in the probot/probot or make the label here?

@bkeepers
Copy link
Contributor

New one in probot/probot makes sense to me.

@tcbyrd tcbyrd added ➡️ Tracking Issue is being tracked in a related Issue or PR 🤖 Probot Core Feedback related to core Probot features labels Mar 20, 2018
@stale
Copy link

stale bot commented May 19, 2018

Is this still causing friction? If so, please comment with any updates or addition details.

@stale stale bot added the wontfix label May 19, 2018
@stale stale bot closed this as completed May 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
➡️ Tracking Issue is being tracked in a related Issue or PR 🤖 Probot Core Feedback related to core Probot features wontfix
Projects
None yet
Development

No branches or pull requests

4 participants