shouldn't this be a promise reject rather than a throw?