func GetErrorFromResponse(body []byte) error {
	type errorStatus struct {
		Error  bool   `json:"error"`
		Status string `json:"status"`
	}

	s := &errorStatus{}
	err := json.Unmarshal(body, s)
	if err != nil || !s.Error {
		return nil
	}

	if s.Status == "" && s.Error {
		return errNoSuccess
	}

	return errors.New(s.Status)
}
// GetErrorFromResponse will return an error generated from the body
GetErrorFromResponse will return an error generated from the body
// GetErrorFromResponse will return an error generated from the body
func GetErrorFromResponse(body []byte) error {
	type errorStatus struct {
		Error  bool   `json:"error"`
		Status string `json:"status"`
	}
	s := &errorStatus{}
	err := json.Unmarshal(body, s)
	if err != nil || !s.Error {
		return nil
	}
	if s.Status == "" && s.Error {
		return errNoSuccess
	}
	return errors.New(s.Status)
}
func GetErrorFromResponse ( body [ ] byte ) error { type errorStatus struct { Error bool `json:"error"` Status string `json:"status"` } s := & errorStatus { } err := json . Unmarshal ( body , s ) if err != nil || ! s . Error { return nil } if s . Status == " " && s . Error { return errNoSuccess } return errors . New ( s . Status ) }
GetErrorFromResponse will return an error generated from the body
GetErrorFromResponse will return an error generated from the body