# "Cleanup: defer, errdefer, and the lost cause": a deferred call that throws# supersedes the error already on its way out.use io;
funcexplode() { throw Error{kind: "close", message: "failed"}; }
funcrisky() {
deferexplode();
throw Error{kind: "first", message: "the real cause"};
}
try {
risky();
} catch (e) {
io.printf("caught %s: %s\n", $e.kind, $e.message);
}