Skip to content

Commit ce61ea4

Browse files
committed
added TriggerExceptionAction to comfortable test of error reporting.
1 parent 5b84d32 commit ce61ea4

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package org.jetbrains.research.groups.ml_methods.error_reporting;
2+
3+
import com.intellij.openapi.actionSystem.AnAction;
4+
import com.intellij.openapi.actionSystem.AnActionEvent;
5+
6+
/**
7+
* Provides functionality to throw a runtime exception when the action is invoked. It is used to test the error reporting
8+
* functions. Don't forget to register the action in plugin.xml to make it work.
9+
*/
10+
public class TriggerExceptionAction extends AnAction {
11+
public void actionPerformed(AnActionEvent e) {
12+
throw new RuntimeException("I'm an artificial exception to test error reporting!");
13+
}
14+
}

src/main/resources/META-INF/plugin.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,5 +75,10 @@
7575
</action>
7676
<add-to-group group-id="InspectCodeGroup" anchor="last"/>
7777
</group>
78+
<!--Action for throwing an exception just to test the reporting of errors into the YouTrack database-->
79+
<action id="org.jetbrains.research.groups.ml_methods.error_reporting.TriggerExceptionAction"
80+
class="org.jetbrains.research.groups.ml_methods.error_reporting.TriggerExceptionAction" text="FireArtificialException">
81+
<keyboard-shortcut keymap="$default" first-keystroke="shift ctrl alt F12"/>
82+
</action>
7883
</actions>
7984
</idea-plugin>

0 commit comments

Comments
 (0)