Reorg read() algorithm

- Less indentation
- The same ordering and handle-error-first as well as cancel(reason)