Added exception handling from https://github.com/gschier/snakewithus-node/commit/6c92a9d24b1d986c359e58c4826882943473c62f