4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/shopify_cli/github/issue_url_generator.rb', line 4
def self.error_url(error)
title = "[Bug]: #{error.class}: #{error.message}"
labels = "type:bug"
stacktrace_text =
if error.backtrace stacktrace = error.backtrace.length < 5 ? error.backtrace : error.backtrace[0..4]
stacktrace.join("\n").to_s
else
""
end
query = URI.encode_www_form({
title: title,
labels: labels,
template: "bug_report.yaml",
stack_trace: stacktrace_text,
os: RUBY_PLATFORM,
cli_version: ShopifyCLI::VERSION,
ruby_version: "#{RUBY_VERSION}p#{RUBY_PATCHLEVEL}",
shell: ENV["SHELL"],
})
"#{ShopifyCLI::Constants::Links::NEW_ISSUE}?#{query}"
end
|