Breaking change for CreateJob

Create job has changed from a tuple return to a single error return
which simplifies how we interact with the api.
This commit is contained in:
Renán Del Valle 2021-04-30 11:17:52 -07:00
parent ae295b9cea
commit 085bc39c50
No known key found for this signature in database
GPG key ID: C240AD6D6F443EC9
3 changed files with 12 additions and 14 deletions

View file

@ -167,7 +167,7 @@ func (r *realisClient) thriftCallWithRetries(
// Print out the error to the user
r.logger.Printf("Client Error: %v", clientErr)
temporary, timedout := processClientError(clientErr)
temporary, timedout := isConnectionError(clientErr)
if !temporary && r.RealisConfig().failOnPermanentErrors {
return nil, errors.Wrap(clientErr, "permanent connection error")
}
@ -257,10 +257,10 @@ func (r *realisClient) thriftCallWithRetries(
return nil, newRetryError(errors.New("ran out of retries"), curStep)
}
// processClientError processes the error received by the client.
// isConnectionError processes the error received by the client.
// The return values indicate weather this was determined to be a temporary error
// and weather it was determined to be a timeout error
func processClientError(err error) (bool, bool) {
func isConnectionError(err error) (bool, bool) {
// Determine if error is a temporary URL error by going up the stack
transportException, ok := err.(thrift.TTransportException)