func (e *baseError) String() string {
	return e.Error()
}
String returns the string representation of the error.
Alias for Error to satisfy the stringer interface.
package errors
import (
	"encoding/json"
	"fmt"
)
func SprintError(code, message, extra string, origErr error) string {
	data := map[string]interface{}{
		"Code":    code,
		"Message": message,
	}
	if len(extra) > 0 {
		data["Extra"] = extra
	}
	if origErr != nil {
		if err, ok := origErr.(Error); ok {
			data["OrigError"] = err
		} else {
			data["OrigError"] = fmt.Sprintf("%T(%s)", origErr, origErr)
		}
	}
	b, _ := json.Marshal(data)
	return string(b)
}
type baseError struct {
	code string
	message string
	errs []error
}
func newBaseError(code, message string, origErrs []error) *baseError {
	b := &baseError{
		code:    code,
		message: message,
		errs:    origErrs,
	}
	return b
}
func (e *baseError) Error() string {
	size := len(e.errs)
	if size > 0 {
		return SprintError(e.code, e.message, "", errorList(e.errs))
	}
	return SprintError(e.code, e.message, "", nil)
}