Skip to content
Snippets Groups Projects
Commit 148da475 authored by Sam McTaggart's avatar Sam McTaggart Committed by Xu Cheng
Browse files

Improve error message for invalid regex to search

Fixes https://github.com/Homebrew/homebrew/issues/50131



This commit removes the error backtrace and improves the error message
if a bad regexp is passed to `brew search`.

Closes Homebrew/homebrew#50173.

Signed-off-by: default avatarMartin Afanasjew <martin@afanasjew.de>
parent af361392
No related branches found
No related tags found
No related merge requests found
......@@ -93,6 +93,8 @@ module Homebrew
when %r{^/(.*)/$} then Regexp.new($1)
else /.*#{Regexp.escape(query)}.*/i
end
rescue RegexpError
odie "#{query} is not a valid regex"
end
def search_taps(rx)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment