debugger

The mystery of the endless Throwable's cause chain shown in the IntelliJ debugger

A Throwable in Java can have a cause which in turn is a Throwable as well. This cause can have a cause and we can have a chain of Throwableobjects which we can follow until a Throwable has no cause. Let me explain this with a small example: 1class Scratch { 2 public static void main(String[] args) { 3 try { 4 try { 5 int division = divide(4, 0); 6 } catch (Exception e) { 7 throw new IllegalArgumentException("got exception calling divide", e); 8 } 9 } catch (Throwable t) { 10 while (t !