mirror of
https://github.com/offen/docker-volume-backup.git
synced 2024-11-22 05:10:28 +01:00
Panic handling does not log reason for script being halted (#334)
This commit is contained in:
parent
810c8871ec
commit
ed5abd5ba8
@ -21,6 +21,9 @@ func main() {
|
|||||||
defer func() {
|
defer func() {
|
||||||
if pArg := recover(); pArg != nil {
|
if pArg := recover(); pArg != nil {
|
||||||
if err, ok := pArg.(error); ok {
|
if err, ok := pArg.(error); ok {
|
||||||
|
s.logger.Error(
|
||||||
|
fmt.Sprintf("Executing the script encountered a panic: %v", err),
|
||||||
|
)
|
||||||
if hookErr := s.runHooks(err); hookErr != nil {
|
if hookErr := s.runHooks(err); hookErr != nil {
|
||||||
s.logger.Error(
|
s.logger.Error(
|
||||||
fmt.Sprintf("An error occurred calling the registered hooks: %s", hookErr),
|
fmt.Sprintf("An error occurred calling the registered hooks: %s", hookErr),
|
||||||
|
Loading…
Reference in New Issue
Block a user