In Java, I can achieve exception chaining by passing another exception to the new exception like this:
try {
doSomething();
} catch (Exception1 ex) {
throw new Exception2("Got exception1 while doing the thing", ex);
}
I would like to achieve a similar result in Dart. How can I do that?