Is it possible to capture all the exceptions of my custom plugin, so I can sent it to a server
I'm writing an IDEA plugin, when my friends use it, it often throws all kind of exceptions and hard to reproduce it in my place.
I'm thinking if I can capture all the exceptions in the IDEA, and submit them to a place, so I can view all of them
I tried to use the code:
Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler {
override def uncaughtException(thread: Thread, throwable: Throwable): Unit = {
println("!!!!!!!!!!!!!!!!!! got unhandled exception from thread: " + thread.getName + ", " + throwable.toString)
}
})
But it doesn't capture anything, because there when there is an example, it will be captured and be logged by `IdeaLogger.error(...)`, which will print it to a log file.
Is there any way to capture them by my custom code?
Please sign in to leave a comment.
You can provide your own extension of com.intellij.openapi.diagnostic.ErrorReportSubmitter which could submit your plugin's exception e.g. via mail.
Implement your own error reporter. There's an example at https://github.com/jansorg/BashSupport/tree/master/src/nu/studer/idea .
You need a custom server side component for that which will send a mail to you or will create an issue in your issue tracker.