mirror of
https://github.com/offen/docker-volume-backup.git
synced 2025-12-23 17:21:10 +01:00
Error from run_script is not consistently passed to deferred functions
This commit is contained in:
@@ -64,7 +64,7 @@ func runScript(c *Config) (err error) {
|
|||||||
|
|
||||||
if initErr := s.init(); initErr != nil {
|
if initErr := s.init(); initErr != nil {
|
||||||
if hookErr := s.runHooks(initErr); hookErr != nil {
|
if hookErr := s.runHooks(initErr); hookErr != nil {
|
||||||
return errwrap.Wrap(
|
err = errwrap.Wrap(
|
||||||
nil,
|
nil,
|
||||||
fmt.Sprintf(
|
fmt.Sprintf(
|
||||||
"error %v instantiating script followed by %v calling the registered hooks",
|
"error %v instantiating script followed by %v calling the registered hooks",
|
||||||
@@ -72,11 +72,13 @@ func runScript(c *Config) (err error) {
|
|||||||
hookErr,
|
hookErr,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
return errwrap.Wrap(initErr, "error instantiating script")
|
err = errwrap.Wrap(initErr, "error instantiating script")
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
return func() (err error) {
|
err = func() (err error) {
|
||||||
scriptErr := func() error {
|
scriptErr := func() error {
|
||||||
if err := s.withLabeledCommands(lifecyclePhaseArchive, func() (err error) {
|
if err := s.withLabeledCommands(lifecyclePhaseArchive, func() (err error) {
|
||||||
restartContainersAndServices, err := s.stopContainersAndServices()
|
restartContainersAndServices, err := s.stopContainersAndServices()
|
||||||
@@ -130,4 +132,6 @@ func runScript(c *Config) (err error) {
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user