IDEA 9.0.1 - How to throw an Exception during Debug?

Hi,

Does anybody know how to throw an exception during debugging. I could have sworn in older intelliJ or maybe eclipse I would simply evaluate 'throw new BlahException();'. However in IntelliJ 9.0.1 it simply says this is not supported in code fragment mode and does not allow it in expression mode.

If this is not possible is there a plugin available. This is useful for emulating a problem without coding it in, then recompiling/redeploying.

Thanks,

Louis

1 comment

On 2/22/2010 6:29 PM, Louis Burton wrote:

Hi,

>

Does anybody know how to throw an exception during debugging. I could have sworn in older intelliJ or maybe eclipse I would simply evaluate 'throw new BlahException();'. However in IntelliJ 9.0.1 it simply says this is not supported in code fragment mode and does not allow it in expression mode.

>

If this is not possible is there a plugin available. This is useful for emulating a problem without coding it in, then recompiling/redeploying.

>

Thanks,

>

Louis

>

---
Original message URL: http://www.jetbrains.net/devnet/message/5257114#5257114

You could try Thread.currentThread().stop(new BlahException());

0

Please sign in to leave a comment.