evilsocket/xray

Error checking

t94j0 opened this issue · 3 comments

t94j0 commented

I see a lot of if err == nil checks, but I don't see you handling errors at all. It might be a good idea to handle and log the errors. It seems like many of the errors can be logged as informational, but some errors like this may want to be logged as a warning, or even this as an error.

Dude did you try to spend 5 minutes to think why I'm ignoring some errors and I'm just panic-ing on others?

The errors I'm ignoring, are not fatal errors (like a closed port, or a non existent domain not being resolved), due to the very nature of this tool, if I'd follow your suggestion, the user would have the terminal full of completely useless log messages.

Try to put just a fmt.Println here and see what happens :)

t94j0 commented

Haha, yeah. That'd be a wall of text.
I just think that some of the errors may want to be logged to a file for informational reasons so that users can troubleshoot configuration issues they may have. If you don't think this tools needs it, then I totally understand. It's just an idea. 😄 😸

So far you only provided places where the error must not be logged at all, if you give me real examples of the usefulness of such logging I'll gladly add it.