-
-
Notifications
You must be signed in to change notification settings - Fork 258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: More deep error messages #159
base: main
Are you sure you want to change the base?
Conversation
(if pkg/errors is too big to include in project, i can rewrite code using std errors.Joins) |
Can't it be done with fmt.Errorf()? |
@xvzc you are right! ty. I've rewrited code using fmt.Errorf |
util/os.go
Outdated
@@ -19,18 +19,16 @@ func SetOsProxy(port int) error { | |||
|
|||
network, err := getDefaultNetwork() | |||
if err != nil { | |||
return fmt.Errorf("failed to get network interfaces, stdout: %s: %w", string(network), err) | |||
return fmt.Errorf("failed to get network interfaces: %w", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be network or network service. We extract an interface from the route
command and try to find a NS that uses it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I rewrote it as failed to get default network
, cause we are calling getDefaultNetwork
.
Without proposed changes, errors on start are very hard to debug.
For example, if i start app with
spoof-dpi -system-proxy=true -debug
I will get:
But with given changes error message is less difficult to understand
(whole problem was with no admin privileges)