Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

command handler doesn't output the read and write errors #9

Open
nak3 opened this issue Dec 5, 2016 · 0 comments
Open

command handler doesn't output the read and write errors #9

nak3 opened this issue Dec 5, 2016 · 0 comments

Comments

@nak3
Copy link
Contributor

nak3 commented Dec 5, 2016

Current codes check the result of Read or Write like this:

  n, err := r.ReadAt(cmd.Buf[:length], int64(offset))
	if n < length {
		log.Errorln("read/read failed: unable to copy enough")
		return cmd.MediumError(), nil
	}
	if err != nil {
		log.Errorln("read/read failed: error:", err)
		return cmd.MediumError(), nil
	}

When Read() and Write() return error, they always make n < length true, and so they return before outputting the error.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant