func ErrorToStatus(err error) int {
	switch err.(type) {
	default:
		return http.StatusInternalServerError
	case *ranch.OwnerNotMatch:
		return http.StatusUnauthorized
	case *ranch.ResourceNotFound:
		return http.StatusNotFound
	case *ranch.ResourceTypeNotFound:
		return http.StatusNotFound
	case *ranch.StateNotMatch:
		return http.StatusConflict
	}
}
func ErrorToStatus(err error) int {
	switch err.(type) {
	default:
		return http.StatusInternalServerError
	case *ranch.OwnerNotMatch:
		return http.StatusUnauthorized
	case *ranch.ResourceNotFound:
		return http.StatusNotFound
	case *ranch.ResourceTypeNotFound:
		return http.StatusNotFound
	case *ranch.StateNotMatch:
		return http.StatusConflict
	}
}
func ErrorToStatus ( err error ) int { switch err . ( type ) { default : return http . StatusInternalServerError case * ranch . OwnerNotMatch : return http . StatusUnauthorized case * ranch . ResourceNotFound : return http . StatusNotFound case * ranch . ResourceTypeNotFound : return http . StatusNotFound case * ranch . StateNotMatch : return http . StatusConflict } }
// ErrorToStatus translates error into http code
ErrorToStatus translates error into http code