Skip to content

specerror: Add NewRFCError and NewRFCErrorOrPanic#627

Merged
zhouhao3 merged 1 commit intoopencontainers:masterfrom
wking:new-rfc-error
Apr 24, 2018
Merged

specerror: Add NewRFCError and NewRFCErrorOrPanic#627
zhouhao3 merged 1 commit intoopencontainers:masterfrom
wking:new-rfc-error

Conversation

@wking
Copy link
Copy Markdown
Contributor

@wking wking commented Apr 18, 2018

So we don't have to dance around with casting to extract structured information from NewError's returned error.

@alban
Copy link
Copy Markdown
Contributor

alban commented Apr 19, 2018

LGTM (but I'm not a maintainer)

// NewRFCErrorOrPanic creates an rfc2119.Error referencing a spec
// violation and panics on failure. This is handy for situations
// where you can't be bothered to check NewRFCError for failure.
func NewRFCErrorOrPanic(code Code, err error, version string) (*rfc2119.Error) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

go fmt fails at this line.
It should be

func NewRFCErrorOrPanic(code Code, err error, version string)  *rfc2119.Error {

"github.com/mndrix/tap-go"
rspecs "github.com/opencontainers/runtime-spec/specs-go"
"github.com/opencontainers/runtime-tools/specerror"
rfc2119 "github.com/opencontainers/runtime-tools/error"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

go fmt fails at this line.
It should be moved one line up.

         rfc2119 "github.com/opencontainers/runtime-tools/error"
 	"github.com/opencontainers/runtime-tools/specerror"

So we don't have to dance around with casting to extract structured
information from NewError's returned error.

Signed-off-by: W. Trevor King <wking@tremily.us>
@wking
Copy link
Copy Markdown
Contributor Author

wking commented Apr 19, 2018

I've fixed the.gofmt errors with dac7b677992f01.

@zhouhao3
Copy link
Copy Markdown

zhouhao3 commented Apr 21, 2018

LGTM

Approved with PullApprove

@zhouhao3 zhouhao3 merged commit 95866ec into opencontainers:master Apr 24, 2018
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.

4 participants