-
-
Notifications
You must be signed in to change notification settings - Fork 9.9k
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
post_url tag raises ArgumentError for invalid name #1825
Conversation
Using post_url tag with invalid name raises TypeError. It should raise ArgumentError and should display detail of the error to fix the error.
@@ -7,6 +7,7 @@ class PostComparer | |||
|
|||
def initialize(name) | |||
all, path, date, slug = *name.sub(/^\//, "").match(MATCHER) | |||
raise ArgumentError unless all |
There was a problem hiding this comment.
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?
@@ -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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Using post_url tag with invalid name raises TypeError.
It should raise ArgumentError and should display detail of the error to
fix the error.