Skip to content

Commit

Permalink
Add JVM info and OS version to GH error report template (#255)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcinVaadin authored Jan 10, 2025
1 parent 74fc12d commit 579d87d
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import com.intellij.openapi.diagnostic.IdeaLoggingEvent
import com.intellij.openapi.diagnostic.SubmittedReportInfo
import com.intellij.util.Consumer
import java.awt.Component
import java.lang.management.ManagementFactory

class CopilotErrorHandler : ErrorReportSubmitter() {

Expand All @@ -32,10 +33,12 @@ class CopilotErrorHandler : ErrorReportSubmitter() {
throwableText = throwableText.substring(0, ghMaxBodyLength)
}

val runtimeMXBean = ManagementFactory.getRuntimeMXBean()
var body =
"Plugin version: **${pluginDescriptor.version}**\n" +
"IDE version: **$appName**\n" +
"OS: **${System.getProperty("os.name")}**\n\n"
"VM: **${runtimeMXBean.vmName + " " + runtimeMXBean.vmVersion + " " + runtimeMXBean.vmVendor}**\n" +
"OS: **${System.getProperty("os.name") + " " + System.getProperty("os.version")}**\n\n"

if (additionalInfo != null) {
body += "Additional info:\n" + "> ${additionalInfo.replace("\\n+".toRegex(), "\n")}" + "\n\n"
Expand Down

0 comments on commit 579d87d

Please sign in to comment.