utils: raise UsageError in parse_author!

Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
nandahkrishna 2021-04-01 22:21:30 +05:30
parent 53a7065bcc
commit 3ce8ef3173
No known key found for this signature in database
GPG Key ID: 067E5FCD58ADF3AA

View File

@ -469,7 +469,7 @@ module Kernel
def parse_author!(author) def parse_author!(author)
/^(?<name>[^<]+?)[ \t]*<(?<email>[^>]+?)>$/ =~ author /^(?<name>[^<]+?)[ \t]*<(?<email>[^>]+?)>$/ =~ author
raise "Unable to parse name and email." if name.blank? && email.blank? raise UsageError, "Unable to parse name and email." if name.blank? && email.blank?
{ name: name, email: email } { name: name, email: email }
end end