Is there a more elegant way to pass errors without reject the whole promise?