Add more error codes and message, reflow some doc comments.

I don't like these generalized errors. Error definitions are cheap. We should be using more of them, not grouping them into large buckets.