rpc/protocol/json/error.go
crusader 96d9105d30 ing
2018-03-20 15:31:54 +09:00

26 lines
624 B
Go

package json
import (
"errors"
crp "git.loafle.net/commons_go/rpc/protocol"
)
var ErrNullResult = errors.New("result is null")
type Error struct {
// A Number that indicates the error type that occurred.
Code crp.ErrorCode `json:"code"` /* required */
// A String providing a short description of the error.
// The message SHOULD be limited to a concise single sentence.
Message string `json:"message"` /* required */
// A Primitive or Structured value that contains additional information about the error.
Data interface{} `json:"data"` /* optional */
}
func (e *Error) Error() string {
return e.Message
}