Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions code.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

var (
unknownCoder defaultCoder = defaultCoder{1, http.StatusInternalServerError, "An internal server error occurred", "http://github.com/marmotedu/errors/README.md"}
unknownCoder defaultCoder = defaultCoder{0, http.StatusInternalServerError, "An internal server error occurred", "http://github.com/marmotedu/errors/README.md"}
)

// Coder defines an interface for an error code detail information.
Expand Down Expand Up @@ -71,7 +71,7 @@ var codes = map[int]Coder{}
var codeMux = &sync.Mutex{}

// Register register a user define error code.
// It will overrid the exist code.
// It will override the exist code.
func Register(coder Coder) {
if coder.Code() == 0 {
panic("code `0` is reserved by `github.com/marmotedu/errors` as unknownCode error code")
Expand Down