Skip to content
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

simple log errors make debug easy #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tnclong
Copy link
Contributor

@tnclong tnclong commented Oct 18, 2019

No description provided.

@tnclong tnclong requested review from sunfmin and ericwo October 18, 2019 05:39
@@ -117,15 +118,28 @@ func VerifyIPNRequest(req *http.Request) (*IPN, bool) {
}

func getCert(ipn *IPN) *x509.Certificate {
if resp, err := http.Get(ipn.SigningCertURL); err == nil {
if body, err := ioutil.ReadAll(resp.Body); err == nil {
block, _ := pem.Decode([]byte(body))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A joke

var body []byte
pem.Decode([]byte(body))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why golang don't give a compile error? Mmmm....

@tnclong
Copy link
Contributor Author

tnclong commented Oct 18, 2019

This commit don't try to fix all not comfortable error process in this package.

Ideally, we should use https://github.com/sirupsen/logrus package for log.
Declare several type(or instance) of errors.
Process all network errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants