Commit Graph

2 Commits

Author SHA1 Message Date
Herbie Ong
e09920e4f8 internal/errors: fix New in eliding prefix
Change-Id: I59c4c03f4115bfe6c4377924fadfd664245e878f
Reviewed-on: https://go-review.googlesource.com/c/164277
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
2019-02-27 22:36:14 +00:00
Joe Tsai
9834a7df51 internal/errors: initial commit
This adds package errors, which provides error handling constructs that are
specific to the protobuf repo. In particular, it provides a NonFatal type
which is useful for capturing non-fatal errors like invalid UTF-8 and required
fields not set.

High-level API:
	type NonFatalErrors []error
		func (NonFatalErrors) Error() string
	type NonFatal struct{ ... }
		func (*NonFatal) Merge(err error) (ok bool)
		func (*NonFatal) AppendInvalidUTF8(field string)
		func (*NonFatal) AppendRequiredNotSet(field string)
	func New(string, ...interface{}) error

Change-Id: I9448c586008240e8987573fe79e0ffb024e7629d
Reviewed-on: https://go-review.googlesource.com/127338
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Herbie Ong <herbie@google.com>
2018-08-02 18:28:47 +00:00