This part is synchronous and doesn't need to be in a promise, does it?  Couldn't this function return a promise or throw an error?  Throwing immediately for a programming error seems better than returning  a promise is synchronously rejected.