github.com/altipla-consulting/ravendb-go-client@v0.1.3/get_response.go (about)

     1  package ravendb
     2  
     3  import "net/http"
     4  
     5  // GetResponse represents result of get request
     6  type GetResponse struct {
     7  	Result       []byte
     8  	Headers      map[string]string
     9  	StatusCode   int
    10  	IsForceRetry bool
    11  }
    12  
    13  func (r *GetResponse) requestHasErrors() bool {
    14  	switch r.StatusCode {
    15  	case 0,
    16  		http.StatusOK,
    17  		http.StatusCreated,
    18  		http.StatusNoContent,
    19  		http.StatusNotModified,
    20  		http.StatusNonAuthoritativeInfo,
    21  		http.StatusNotFound:
    22  		return false
    23  	default:
    24  		return true
    25  	}
    26  }