local thread = require("thread") local tty = require("tty") print("p start") local reader = thread.create(function() print("reader start") error("thread abort") -- throws an exception print("reader done") end) print("p end", reader:status())