Why are we resolving on error? Should not we reject the promise?