26 lines
624 B
Go
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
|
|
}
|