@ -1148,9 +1148,11 @@ func (s *Service) execute(w http.ResponseWriter, r *http.Request, qp QueryParams
if resultsErr != nil {
stats . Add ( numRemoteExecutionsFailed , 1 )
if resultsErr . Error ( ) == "unauthorized" {
http . Error ( w , "remote e xecute not authorized", http . StatusUnauthorized )
http . Error ( w , "remote E xecute not authorized", http . StatusUnauthorized )
return
}
resultsErr = fmt . Errorf ( "node failed to process Execute on remote node at %s: %s" ,
addr , resultsErr . Error ( ) )
}
stats . Add ( numRemoteExecutions , 1 )
}
@ -1295,8 +1297,8 @@ func (s *Service) handleRequest(w http.ResponseWriter, r *http.Request, qp Query
Freshness : qp . Freshness ( ) . Nanoseconds ( ) ,
}
results , result Err := s . store . Request ( eqr )
if result Err != nil && result Err == store . ErrNotLeader {
results , result s Err := s . store . Request ( eqr )
if result s Err != nil && result s Err == store . ErrNotLeader {
if s . DoRedirect ( w , r , qp ) {
return
}
@ -1317,20 +1319,22 @@ func (s *Service) handleRequest(w http.ResponseWriter, r *http.Request, qp Query
}
w . Header ( ) . Add ( ServedByHTTPHeader , addr )
results , result Err = s . cluster . Request ( eqr , addr , makeCredentials ( username , password ) ,
results , result s Err = s . cluster . Request ( eqr , addr , makeCredentials ( username , password ) ,
qp . Timeout ( defaultTimeout ) , qp . Retries ( 0 ) )
if result Err != nil {
if result s Err != nil {
stats . Add ( numRemoteRequestsFailed , 1 )
if result Err. Error ( ) == "unauthorized" {
http . Error ( w , "remote r equest not authorized", http . StatusUnauthorized )
if result s Err. Error ( ) == "unauthorized" {
http . Error ( w , "remote R equest not authorized", http . StatusUnauthorized )
return
}
resultsErr = fmt . Errorf ( "node failed to process Request on remote node at %s: %s" ,
addr , resultsErr . Error ( ) )
}
stats . Add ( numRemoteRequests , 1 )
}
if result Err != nil {
resp . Error = result Err. Error ( )
if result s Err != nil {
resp . Error = result s Err. Error ( )
} else {
resp . Results . ExecuteQueryResponse = results
}