ooni-probe-cli/internal/netxlite/errorsx/doc.go
Simone Basso a56b284b0e
refactor(netxlite/errors): improve docs and format code (#481)
No real functional change. A few are needed and they will come
next. With this diff I just wanted to do cosmetic changes and
documentation changes, to ensure this package is okay.

See https://github.com/ooni/probe/issues/1591
2021-09-07 20:39:32 +02:00

21 lines
822 B
Go

// Package errorsx contains code to classify errors.
//
// We define the ErrWrapper type, that should wrap any error
// and map it to the corresponding OONI failure.
//
// See https://github.com/ooni/spec/blob/master/data-formats/df-007-errors.md
// for a list of OONI failure strings.
//
// We define ClassifyXXX functions that map an `error` type to
// the corresponding OONI failure.
//
// When we cannot map an error to an OONI failure we return
// an "unknown_failure: XXX" string where the XXX part has
// been scrubbed so to remove any network endpoints.
//
// The general approach we have been following for this
// package has been to return the same strings that we used
// with the previous measurement engine, Measurement Kit
// available at https://github.com/measurement-kit/measurement-kit.
package errorsx