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

post_url tag raises ArgumentError for invalid name #1825

Merged

Conversation

arika
Copy link
Contributor

@arika arika commented Dec 14, 2013

Using post_url tag with invalid name raises TypeError.

It should raise ArgumentError and should display detail of the error to
fix the error.

Using post_url tag with invalid name raises TypeError.

It should raise ArgumentError and should display detail of the error to
fix the error.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) when pulling a5545d5 on arika:smallfix_post_url_tag_behavior_for_invalid_names into b7bdcb1 on jekyll:master.

@@ -7,6 +7,7 @@ class PostComparer

def initialize(name)
all, path, date, slug = *name.sub(/^\//, "").match(MATCHER)
raise ArgumentError unless all
Copy link
Member

Choose a reason for hiding this comment

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

Can you make this error more descriptive?

@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) when pulling 9d259fe on arika:smallfix_post_url_tag_behavior_for_invalid_names into b7bdcb1 on jekyll:master.

@@ -7,6 +7,7 @@ class PostComparer

def initialize(name)
all, path, date, slug = *name.sub(/^\//, "").match(MATCHER)
raise ArgumentError.new("invalid post name") unless all
Copy link
Member

Choose a reason for hiding this comment

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

Can you give the offending post name in here too? Want to be as helpful as possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How about "'#{name}' does not contain valid date and/or title" ?

Copy link
Member

Choose a reason for hiding this comment

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

👍

@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) when pulling ecab2eb on arika:smallfix_post_url_tag_behavior_for_invalid_names into b7bdcb1 on jekyll:master.

@parkr
Copy link
Member

parkr commented Dec 17, 2013

LGTM! Thanks for this, @arika.

@mattr-?

parkr added a commit that referenced this pull request Dec 26, 2013
@parkr parkr merged commit 791c6d8 into jekyll:master Dec 26, 2013
parkr added a commit that referenced this pull request Dec 26, 2013
@ghost ghost assigned parkr Dec 26, 2013
@jekyll jekyll locked and limited conversation to collaborators Feb 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants