refactor(errorsx): prepare for splitting the package (#476)

We will move the sane part of this package to i/netxlite/errorsx
and we will move the rest to i/e/legacy/errorsx.

What is the sane part? The sane part is error classifiers plus
the definition of ErrWrapper. The rest, including the rules
on how to decide whether an operation is major, are tricky and
we should consider them legacy and replace them with rules
that are more easy to understand and reason on.

Part of https://github.com/ooni/probe/issues/1591
This commit is contained in:
Simone Basso 2021-09-07 15:46:32 +02:00 committed by GitHub
commit ccb3a644e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 96 additions and 90 deletions

View file

@ -1,5 +1,5 @@
// Code generated by go generate; DO NOT EDIT.
// Generated: 2021-09-07 14:56:43.206193 +0200 CEST m=+0.141131209
// Generated: 2021-09-07 15:15:03.350386 +0200 CEST m=+0.135456751
package errorsx
@ -60,10 +60,10 @@ const (
FailureJSONParseError = "json_parse_error"
)
// toSyscallErr converts a syscall error to the
// classifySyscallError converts a syscall error to the
// proper OONI error. Returns the OONI error string
// on success, an empty string otherwise.
func toSyscallErr(err error) string {
func classifySyscallError(err error) string {
// filter out system errors: necessary to detect all windows errors
// https://github.com/ooni/probe/issues/1526 describes the problem
// of mapping localized windows errors.