Skip to content

Better human-readable error messages #51

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 5 commits into from
May 2, 2016
Merged

Better human-readable error messages #51

merged 5 commits into from
May 2, 2016

Conversation

benbalter
Copy link
Contributor

This pull request is intended to move the more descriptive human-readable error messages that GitHub Pages uses into the open source Ruby gem, where they can be shared between implementations. Specifically, errors, as exposed via HealthCheck#reason have an expanded #message method, and also expose #message_with_url which would provide a URL to the help docs.

The code's definitely a bit rough and could use some 👀.

@benbalter benbalter self-assigned this Apr 29, 2016
def message_with_url
msg = message.gsub(/\s+/, " ").squeeze(" ").strip
msg << "." unless msg =~ /\.$/
[msg, more_info].join(" ")
Copy link
Contributor

Choose a reason for hiding this comment

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

This is really confusing. Can you write a comment about what it should produce, i.e. provide an example?

@parkr
Copy link
Contributor

parkr commented Apr 29, 2016

Looks pretty good to me.

@benbalter
Copy link
Contributor Author

@parkr good calls both. Updated.

@benbalter benbalter merged commit 43295a7 into master May 2, 2016
@benbalter benbalter deleted the sync-messages branch May 2, 2016 16:36
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