refactor(netxlite/errorsx): extract string-suffix classifier (#482)

This change makes the code more tidy and easier to read.

No functional change, though.

See https://github.com/ooni/probe/issues/1591.
This commit is contained in:
Simone Basso 2021-09-07 21:18:26 +02:00 committed by GitHub
commit b7786a7324
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 17 additions and 18 deletions

View file

@ -1,5 +1,5 @@
// Code generated by go generate; DO NOT EDIT.
// Generated: 2021-09-07 20:26:06.502417 +0200 CEST m=+0.133209876
// Generated: 2021-09-07 20:42:20.172357 +0200 CEST m=+0.135433792
package errorsx
@ -64,9 +64,6 @@ const (
// proper OONI error. Returns the OONI error string
// on success, an empty string otherwise.
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.
var errno syscall.Errno
if !errors.As(err, &errno) {
return ""