Merge pull request #1646 from MikeMcQuaid/report-deprecations-to-tap
Tell people to report URL/tap deprecations to the tap.
This commit is contained in:
commit
d085a47124
@ -138,6 +138,14 @@ rescue RuntimeError, SystemCallError => e
|
|||||||
onoe e
|
onoe e
|
||||||
$stderr.puts e.backtrace if ARGV.debug?
|
$stderr.puts e.backtrace if ARGV.debug?
|
||||||
exit 1
|
exit 1
|
||||||
|
rescue MethodDeprecatedError => e
|
||||||
|
Utils::Analytics.report_exception(e)
|
||||||
|
onoe e
|
||||||
|
if e.issues_url
|
||||||
|
$stderr.puts "If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):"
|
||||||
|
$stderr.puts " #{Formatter.url(e.issues_url)}"
|
||||||
|
end
|
||||||
|
exit 1
|
||||||
rescue Exception => e
|
rescue Exception => e
|
||||||
Utils::Analytics.report_exception(e)
|
Utils::Analytics.report_exception(e)
|
||||||
onoe e
|
onoe e
|
||||||
|
@ -56,7 +56,9 @@ end
|
|||||||
|
|
||||||
class FormulaSpecificationError < StandardError; end
|
class FormulaSpecificationError < StandardError; end
|
||||||
|
|
||||||
class MethodDeprecatedError < StandardError; end
|
class MethodDeprecatedError < StandardError
|
||||||
|
attr_accessor :issues_url
|
||||||
|
end
|
||||||
|
|
||||||
class FormulaUnavailableError < RuntimeError
|
class FormulaUnavailableError < RuntimeError
|
||||||
attr_reader :name
|
attr_reader :name
|
||||||
|
@ -151,6 +151,11 @@ class Formulary
|
|||||||
FileUtils.rm_f(path)
|
FileUtils.rm_f(path)
|
||||||
curl url, "-o", path
|
curl url, "-o", path
|
||||||
super
|
super
|
||||||
|
rescue MethodDeprecatedError => e
|
||||||
|
if url =~ %r{github.com/([\w-]+)/homebrew-([\w-]+)/}
|
||||||
|
e.issues_url = "https://github.com/#{$1}/homebrew-#{$2}/issues/new"
|
||||||
|
end
|
||||||
|
raise
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -202,6 +207,13 @@ class Formulary
|
|||||||
rescue FormulaUnavailableError => e
|
rescue FormulaUnavailableError => e
|
||||||
raise TapFormulaUnavailableError.new(tap, name), "", e.backtrace
|
raise TapFormulaUnavailableError.new(tap, name), "", e.backtrace
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def load_file
|
||||||
|
super
|
||||||
|
rescue MethodDeprecatedError => e
|
||||||
|
e.issues_url = formula.tap.issues_url || formula.tap.to_s
|
||||||
|
raise
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class NullLoader < FormulaLoader
|
class NullLoader < FormulaLoader
|
||||||
|
Loading…
x
Reference in New Issue
Block a user