Cannot set a breakpoint condition on an exception breakpoint

Answered

Hi,

What I am trying to do is to set an exception breakpoint targeted to one of my exceptions but suspend only when the message of the exception has a certain value. This exception overrides the constructors properly (autogenerated by IntelliJ). I am throwing the exception with the appropriate message.

I have enabled the condition check and put

this.getMessage() != null && this.getMessage().equals("oh my god!")

What happens is that when the exception is raised and the breakpoint activated, the following error is shown:

 

Here it is MyException code:

public class MyException extends RuntimeException{
public MyException() {
super();
}

public MyException(String message) {
super(message);
}

public MyException(String message, Throwable cause) {
super(message, cause);
}

public MyException(Throwable cause) {
super(cause);
}

protected MyException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
}
}

And I am raising the exception like

throw new MyException("oh my god!");

I am using

Community 2018.3.1, build #IC-183.4588.61, build on December 4, 2018

JRE: 1.8.0_152-release-1343-b16 amd64

JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o

Ubuntu 14.04

Thanks in advance

0

Please sign in to leave a comment.