File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -18,12 +18,16 @@ func (w *Worker) checkIn(config *library.Worker) error {
1818 logrus .Infof ("retrieving worker %s from the server" , config .GetHostname ())
1919 _ , resp , err := w .VelaClient .Worker .Get (config .GetHostname ())
2020 if err != nil {
21+ respErr := fmt .Errorf ("unable to retrieve worker %s from the server: %v" , config .GetHostname (), err )
22+ if resp == nil {
23+ return respErr
24+ }
2125 // if we receive a 404 the worker needs to be registered
2226 if resp .StatusCode == http .StatusNotFound {
2327 return w .register (config )
2428 }
2529
26- return fmt . Errorf ( "unable to retrieve worker %s from the server: %v" , config . GetHostname (), err )
30+ return respErr
2731 }
2832
2933 // if we were able to GET the worker, update it
You can’t perform that action at this time.
0 commit comments