Made errors thrown during N-API initialisation cause a crash