Add documentation for mapError and chainError.