Commit 56f43338 authored by Matt Bell's avatar Matt Bell Committed by Juan Batiz-Benet

commands: Added Response

parent e0719843
package commands
type ErrorType uint
const (
Normal ErrorType = iota // general errors
Client // error was caused by the client, (e.g. invalid CLI usage)
// TODO: add more types of errors for better error-specific handling
)
type Response struct {
req *Request
Error error
ErrorType ErrorType
Value interface{}
}
func (r *Response) SetError(err error, errType ErrorType) {
r.Error = err
r.ErrorType = errType
}
/*func (r *Response) Encode() ([]byte, error) {
}*/
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment