Skip to content

Conversation

lukedirtwalker
Copy link
Collaborator

@lukedirtwalker lukedirtwalker commented Sep 20, 2019

Those checks are dangerous since a refactor could easily break them.
Using xerrors.Is instead is safer against refactors.

Contributes #3042


This change is Reviewable

Those checks are dangerous since a refactor could easily break them.
Using xerrors.Is instead is safer against refactors.

Contributes scionproto#3042
Copy link
Contributor

@oncilla oncilla left a comment

Choose a reason for hiding this comment

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

Reviewed 18 of 18 files at r1.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @lukedirtwalker)


go/border/rpkt/l4.go, line 28 at r1 (raw file):

If no context is used prefer using the standard libs New function.


go/border/rpkt/rpkt.go, line 306 at r1 (raw file):

	// L4 header was parsed without error, then parse payload
	if sp.Pld, err = rp.Payload(verify); err != nil {
		if xerrors.Is(err, ErrUnsupportedL4) {

if !xerrors.Is(err, ErrUn..) {return nil, err}
return will be sp, nil below.


go/lib/addr/host.go, line 60 at r1 (raw file):

var (
	// ErrBadHostAddrType indicates an invalid host address type.
	ErrBadHostAddrType = serrors.New("unsupported host address type")

errors.New


go/lib/addr/host.go, line 62 at r1 (raw file):

	ErrBadHostAddrType = serrors.New("unsupported host address type")
	// ErrMalformedHostAddrType indicates a malformed host address type.
	ErrMalformedHostAddrType = serrors.New("malformed host address type")

ditto

Copy link
Collaborator Author

@lukedirtwalker lukedirtwalker left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @oncilla)


go/border/rpkt/l4.go, line 28 at r1 (raw file):

Previously, Oncilla wrote…

If no context is used prefer using the standard libs New function.

Done.


go/border/rpkt/rpkt.go, line 306 at r1 (raw file):

Previously, Oncilla wrote…

if !xerrors.Is(err, ErrUn..) {return nil, err}
return will be sp, nil below.

Done.


go/lib/addr/host.go, line 60 at r1 (raw file):

Previously, Oncilla wrote…

errors.New

No we should use serrors.New I fixed the doc.


go/lib/addr/host.go, line 62 at r1 (raw file):

Previously, Oncilla wrote…

ditto

Done.

Copy link
Contributor

@oncilla oncilla left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r2.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

Copy link
Contributor

@oncilla oncilla left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r3.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@lukedirtwalker lukedirtwalker merged commit 0c2efba into scionproto:master Sep 20, 2019
@lukedirtwalker lukedirtwalker deleted the pubNewErrorApproach2 branch September 20, 2019 15:10
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