зеркало из https://github.com/github/ruby.git
[rubygems/rubygems] Show exception cause in bug report template
https://github.com/rubygems/rubygems/commit/84b163e804
This commit is contained in:
Родитель
c603f897a3
Коммит
9fdef28687
|
@ -65,8 +65,7 @@ module Bundler
|
||||||
--- ERROR REPORT TEMPLATE -------------------------------------------------------
|
--- ERROR REPORT TEMPLATE -------------------------------------------------------
|
||||||
|
|
||||||
```
|
```
|
||||||
#{e.class}: #{e.message}
|
#{exception_message(e)}
|
||||||
#{e.backtrace && e.backtrace.join("\n ").chomp}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
#{Bundler::Env.report}
|
#{Bundler::Env.report}
|
||||||
|
@ -85,6 +84,21 @@ module Bundler
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def exception_message(error)
|
||||||
|
message = serialized_exception_for(error)
|
||||||
|
cause = error.cause
|
||||||
|
return message unless cause
|
||||||
|
|
||||||
|
message + serialized_exception_for(cause)
|
||||||
|
end
|
||||||
|
|
||||||
|
def serialized_exception_for(e)
|
||||||
|
<<-EOS.gsub(/^ {8}/, "")
|
||||||
|
#{e.class}: #{e.message}
|
||||||
|
#{e.backtrace && e.backtrace.join("\n ").chomp}
|
||||||
|
EOS
|
||||||
|
end
|
||||||
|
|
||||||
def issues_url(exception)
|
def issues_url(exception)
|
||||||
message = exception.message.lines.first.tr(":", " ").chomp
|
message = exception.message.lines.first.tr(":", " ").chomp
|
||||||
message = message.split("-").first if exception.is_a?(Errno)
|
message = message.split("-").first if exception.is_a?(Errno)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче