- fixed error handling for chained promises
- tests for chaining and error handling