diff --git a/gaper.go b/gaper.go index c5d044e..d5d7186 100644 --- a/gaper.go +++ b/gaper.go @@ -144,11 +144,13 @@ func restart(builder Builder, runner Runner) error { } if err := builder.Build(); err != nil { - return fmt.Errorf("build error: %v", err) + logger.Error("Error building binary during a restart: ", err) + return nil } if _, err := runner.Run(); err != nil { - return fmt.Errorf("run error: %v", err) + logger.Error("Error starting process during a restart: ", err) + return nil } return nil diff --git a/gaper_test.go b/gaper_test.go index 15c9252..c5862d9 100644 --- a/gaper_test.go +++ b/gaper_test.go @@ -247,8 +247,7 @@ func TestGaperRestartBuildFail(t *testing.T) { mockRunner.On("Exited").Return(true) err := restart(mockBuilder, mockRunner) - assert.NotNil(t, err, "restart error") - assert.Equal(t, "build error: build-error", err.Error()) + assert.Nil(t, err, "restart error") mockBuilder.AssertExpectations(t) mockRunner.AssertExpectations(t) } @@ -263,8 +262,7 @@ func TestGaperRestartRunFail(t *testing.T) { mockRunner.On("Exited").Return(true) err := restart(mockBuilder, mockRunner) - assert.NotNil(t, err, "restart error") - assert.Equal(t, "run error: run-error", err.Error()) + assert.Nil(t, err, "restart error") mockBuilder.AssertExpectations(t) mockRunner.AssertExpectations(t) }