Update CONTRIBUTING.md

This commit is contained in:
Aaron Boodman
2017-03-07 13:45:43 -08:00
committed by GitHub
parent 873422075a
commit b36dbf4308

View File

@@ -56,18 +56,14 @@ In general, for Public API in Noms, we use the Go-style of returning errors by d
For non-exposed code, we do provide, and use, some wrappers to do Exception-style error handling. There *must* be an overriding rationale for using this style, however. One reason to use the Exception-style is that the current code doesn't know how to proceed and needs to panic, but you want to signal that a calling function somewhere up the stack might be able to recover from the failure and continue.
Test code rarely, if ever, needs to or should use the following Exception-style functions.
For these cases, please use the following family of functions to 'raise' a 'catchable' error (see [go/d/try.go](https://godoc.org/github.com/attic-labs/noms/go/d)):
* For problems that are conceptually `asserts`, meaning that the program cannot meaningfully continue, use the following calls:
* d.Chk.Error()
* d.Chk.NoError()
* d.Chk.True()
* d.Chk.False()
* For problems that might occur during correct processing, you can choose the Go-style of returned errors, or use the following to 'raise' a 'catchable' error (see [go/d/try.go](https://godoc.org/github.com/attic-labs/noms/go/d)):
* d.PanicIfError()
* d.PanicIfTrue()
* d.PanicIfFalse()
You might see some old code that uses functions that seem similar starting with `d.Chk`, however we are going to remove those and don't want to use them for new code. See #3258 for details.
## Submitting PRs
We follow a code review protocol dervied from the one that the [Chromium team](https://www.chromium.org/) uses: