@@ -579,14 +579,16 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) {
579579 )
580580 ok := false
581581 isManualXml := false
582+ callFailedStr := "EPN Configure call failed"
582583
583584 pdpConfigOption , ok = varStack ["pdp_config_option" ]
584585 if ! ok {
585586 msg := "cannot acquire PDP workflow configuration mode"
586587 log .WithField ("partition" , envId ).
587588 WithField ("call" , "Configure" ).
588589 Error (msg )
589- call .VarStack ["__call_error" ] = msg
590+ call .VarStack ["__call_error_reason" ] = msg
591+ call .VarStack ["__call_error" ] = callFailedStr
590592 return
591593 }
592594 switch pdpConfigOption {
@@ -599,7 +601,8 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) {
599601 log .WithField ("partition" , envId ).
600602 WithField ("call" , "Configure" ).
601603 Error (msg )
602- call .VarStack ["__call_error" ] = msg
604+ call .VarStack ["__call_error_reason" ] = msg
605+ call .VarStack ["__call_error" ] = callFailedStr
603606 return
604607 }
605608
@@ -610,7 +613,8 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) {
610613 log .WithField ("partition" , envId ).
611614 WithField ("call" , "Configure" ).
612615 Error (msg )
613- call .VarStack ["__call_error" ] = msg
616+ call .VarStack ["__call_error_reason" ] = msg
617+ call .VarStack ["__call_error" ] = callFailedStr
614618 return
615619 }
616620 isManualXml = true
@@ -621,7 +625,8 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) {
621625 WithField ("call" , "Configure" ).
622626 WithField ("value" , pdpConfigOption ).
623627 Error (msg )
624- call .VarStack ["__call_error" ] = msg
628+ call .VarStack ["__call_error_reason" ] = msg
629+ call .VarStack ["__call_error" ] = callFailedStr
625630 return
626631 }
627632
@@ -631,7 +636,8 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) {
631636 log .WithField ("partition" , envId ).
632637 WithField ("call" , "Configure" ).
633638 Error (msg )
634- call .VarStack ["__call_error" ] = msg
639+ call .VarStack ["__call_error_reason" ] = msg
640+ call .VarStack ["__call_error" ] = callFailedStr
635641 return
636642 }
637643
@@ -641,7 +647,8 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) {
641647 log .WithField ("partition" , envId ).
642648 WithField ("call" , "Configure" ).
643649 Error (msg )
644- call .VarStack ["__call_error" ] = msg
650+ call .VarStack ["__call_error_reason" ] = msg
651+ call .VarStack ["__call_error" ] = callFailedStr
645652 return
646653 }
647654
@@ -670,10 +677,8 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) {
670677 WithField ("partition" , envId ).
671678 WithField ("call" , "Configure" ).
672679 WithError (err ).Error ("ODC error" )
673- log .WithField ("partition" , envId ).
674- WithField ("call" , "Configure" ).
675- Error ("EPN Configure call failed" )
676- call .VarStack ["__call_error" ] = err .Error ()
680+ call .VarStack ["__call_error_reason" ] = err .Error ()
681+ call .VarStack ["__call_error" ] = callFailedStr
677682 }
678683
679684 return
@@ -691,6 +696,7 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) {
691696 runNumberu64 uint64
692697 err error
693698 )
699+ callFailedStr := "EPN Start call failed"
694700
695701 runNumberu64 , err = strconv .ParseUint (rn , 10 , 32 )
696702 if err != nil {
@@ -715,10 +721,8 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) {
715721 WithField ("partition" , envId ).
716722 WithField ("call" , "Start" ).
717723 Error ("ODC error" )
718- log .WithField ("partition" , envId ).
719- WithField ("call" , "Start" ).
720- Error ("EPN Start call failed" )
721- call .VarStack ["__call_error" ] = err .Error ()
724+ call .VarStack ["__call_error_reason" ] = err .Error ()
725+ call .VarStack ["__call_error" ] = callFailedStr
722726 }
723727 return
724728 }
@@ -735,6 +739,7 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) {
735739 runNumberu64 uint64
736740 err error
737741 )
742+ callFailedStr := "EPN Stop call failed"
738743
739744 runNumberu64 , err = strconv .ParseUint (rn , 10 , 32 )
740745 if err != nil {
@@ -755,10 +760,8 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) {
755760 WithField ("partition" , envId ).
756761 WithField ("call" , "Stop" ).
757762 Error ("ODC error" )
758- log .WithField ("partition" , envId ).
759- WithField ("call" , "Stop" ).
760- Error ("EPN Stop call failed" )
761- call .VarStack ["__call_error" ] = err .Error ()
763+ call .VarStack ["__call_error_reason" ] = err .Error ()
764+ call .VarStack ["__call_error" ] = callFailedStr
762765 }
763766 return
764767 }
@@ -767,6 +770,8 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) {
767770
768771 timeout := callable .AcquireTimeout (ODC_RESET_TIMEOUT , varStack , "Reset" , envId )
769772
773+ callFailedStr := "EPN Reset call failed"
774+
770775 ctx , cancel := context .WithTimeout (context .Background (), timeout )
771776 defer cancel ()
772777 err := handleReset (ctx , p .odcClient , nil , envId )
@@ -776,10 +781,8 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) {
776781 WithField ("partition" , envId ).
777782 WithField ("call" , "Reset" ).
778783 Error ("ODC error" )
779- log .WithField ("partition" , envId ).
780- WithField ("call" , "Reset" ).
781- Error ("EPN Reset call failed" )
782- call .VarStack ["__call_error" ] = err .Error ()
784+ call .VarStack ["__call_error_reason" ] = err .Error ()
785+ call .VarStack ["__call_error" ] = callFailedStr
783786 }
784787 return
785788 }
@@ -788,6 +791,8 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) {
788791
789792 timeout := callable .AcquireTimeout (ODC_GENERAL_OP_TIMEOUT , varStack , "EnsureCleanupLegacy" , envId )
790793
794+ callFailedStr := "EPN EnsureCleanupLegacy call failed"
795+
791796 ctx , cancel := context .WithTimeout (context .Background (), timeout )
792797 defer cancel ()
793798 err := handleCleanupLegacy (ctx , p .odcClient , nil , envId )
@@ -796,12 +801,9 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) {
796801 WithField ("level" , infologger .IL_Support ).
797802 WithField ("partition" , envId ).
798803 WithField ("call" , "EnsureCleanupLegacy" ).
799-
800804 Error ("ODC error" )
801- log .WithField ("partition" , envId ).
802- WithField ("call" , "EnsureCleanupLegacy" ).
803- Error ("EPN Cleanup sequence failed" )
804- call .VarStack ["__call_error" ] = err .Error ()
805+ call .VarStack ["__call_error_reason" ] = err .Error ()
806+ call .VarStack ["__call_error" ] = callFailedStr
805807 }
806808 return
807809 }
@@ -810,6 +812,8 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) {
810812
811813 timeout := callable .AcquireTimeout (ODC_GENERAL_OP_TIMEOUT , varStack , "EnsureCleanup" , envId )
812814
815+ callFailedStr := "EPN EnsureCleanup call failed"
816+
813817 ctx , cancel := context .WithTimeout (context .Background (), timeout )
814818 defer cancel ()
815819 err := handleCleanup (ctx , p .odcClient , nil , envId )
@@ -818,12 +822,9 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) {
818822 WithField ("level" , infologger .IL_Support ).
819823 WithField ("partition" , envId ).
820824 WithField ("call" , "EnsureCleanup" ).
821-
822825 Error ("ODC error" )
823- log .WithField ("partition" , envId ).
824- WithField ("call" , "EnsureCleanup" ).
825- Error ("EPN Cleanup sequence failed" )
826- call .VarStack ["__call_error" ] = err .Error ()
826+ call .VarStack ["__call_error_reason" ] = err .Error ()
827+ call .VarStack ["__call_error" ] = callFailedStr
827828 }
828829 return
829830 }
@@ -832,6 +833,8 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) {
832833
833834 timeout := callable .AcquireTimeout (ODC_GENERAL_OP_TIMEOUT , varStack , "PreDeploymentCleanup" , envId )
834835
836+ callFailedStr := "EPN PreDeploymentCleanup call failed"
837+
835838 ctx , cancel := context .WithTimeout (context .Background (), timeout )
836839 defer cancel ()
837840 err := handleCleanup (ctx , p .odcClient , nil , "" )
@@ -840,12 +843,9 @@ func (p *Plugin) CallStack(data interface{}) (stack map[string]interface{}) {
840843 WithField ("level" , infologger .IL_Support ).
841844 WithField ("partition" , envId ).
842845 WithField ("call" , "PreDeploymentCleanup" ).
843-
844846 Error ("ODC error" )
845- log .WithField ("partition" , envId ).
846- WithField ("call" , "PreDeploymentCleanup" ).
847- Error ("EPN PreDeploymentCleanup sequence failed" )
848- call .VarStack ["__call_error" ] = err .Error ()
847+ call .VarStack ["__call_error_reason" ] = err .Error ()
848+ call .VarStack ["__call_error" ] = callFailedStr
849849 }
850850 return
851851 }
0 commit comments