This snippet is hard to read, few things can be improved
1. We don't need error handler after every then, if we don't have different code, 1 outermost error function would suffice.
2. Promise chaining pattern used can be improved, like we need not create a promise object again on line 9.