Using a promise for the setTimeout call is broken in this case, as the error would again be thrown in a promise operation, and so not exposed