diff --git a/internal/sbi/consumer/pcf_service.go b/internal/sbi/consumer/pcf_service.go index fad706f..81711ce 100644 --- a/internal/sbi/consumer/pcf_service.go +++ b/internal/sbi/consumer/pcf_service.go @@ -119,7 +119,6 @@ func (s *npcfService) AMPolicyControlCreate( default: return nil, openapi.ReportError("openapi error") } - } return nil, nil } @@ -203,20 +202,20 @@ func (s *npcfService) AMPolicyControlDelete(ue *amf_context.AmfUe) (problemDetai ue.RemoveAmPolicyAssociation() } else { switch apiErr := err.(type) { - case openapi.GenericOpenAPIError: - // API error - switch errorModel := apiErr.Model().(type) { - case Npcf_AMPolicy.DeleteIndividualAMPolicyAssociationError: - return &errorModel.ProblemDetails, err - case error: - return openapi.ProblemDetailsSystemFailure(errorModel.Error()), err - default: - return nil, openapi.ReportError("openapi error") - } + case openapi.GenericOpenAPIError: + // API error + switch errorModel := apiErr.Model().(type) { + case Npcf_AMPolicy.DeleteIndividualAMPolicyAssociationError: + return &errorModel.ProblemDetails, err case error: - return openapi.ProblemDetailsSystemFailure(apiErr.Error()), apiErr + return openapi.ProblemDetailsSystemFailure(errorModel.Error()), err default: - return nil, openapi.ReportError("openapi error") + return nil, openapi.ReportError("openapi error") + } + case error: + return openapi.ProblemDetailsSystemFailure(apiErr.Error()), apiErr + default: + return nil, openapi.ReportError("openapi error") } } return nil, err diff --git a/internal/sbi/consumer/smf_service.go b/internal/sbi/consumer/smf_service.go index d25d8bf..7b7303d 100644 --- a/internal/sbi/consumer/smf_service.go +++ b/internal/sbi/consumer/smf_service.go @@ -180,13 +180,13 @@ func (s *nsmfService) SendCreateSmContextRequest(ue *amf_context.AmfUe, smContex case openapi.GenericOpenAPIError: // API error switch errModel := errType.Model().(type) { - case Nsmf_PDUSession.PostSmContextsError: - problemDetail = &errModel.ProblemDetails - errorResponse = &errModel.PostSmContextsError - case error: - err1 = errModel - default: - err1 = openapi.ReportError("openapi error") + case Nsmf_PDUSession.PostSmContextsError: + problemDetail = &errModel.ProblemDetails + errorResponse = &errModel.PostSmContextsError + case error: + err1 = errModel + default: + err1 = openapi.ReportError("openapi error") } case error: problemDetail = openapi.ProblemDetailsSystemFailure(err1.Error()) @@ -491,13 +491,13 @@ func (s *nsmfService) SendUpdateSmContextRequest(smContext *amf_context.SmContex case openapi.GenericOpenAPIError: // API error switch errModel := errType.Model().(type) { - case Nsmf_PDUSession.UpdateSmContextError: - problemDetail = &errModel.ProblemDetails - errorResponse = &errModel.UpdateSmContextResponse400 - case error: - err1 = errModel - default: - err1 = openapi.ReportError("openapi error") + case Nsmf_PDUSession.UpdateSmContextError: + problemDetail = &errModel.ProblemDetails + errorResponse = &errModel.UpdateSmContextResponse400 + case error: + err1 = errModel + default: + err1 = openapi.ReportError("openapi error") } case error: problemDetail = openapi.ProblemDetailsSystemFailure(err1.Error()) diff --git a/internal/sbi/consumer/udm_service.go b/internal/sbi/consumer/udm_service.go index 55bd485..16f2740 100644 --- a/internal/sbi/consumer/udm_service.go +++ b/internal/sbi/consumer/udm_service.go @@ -118,8 +118,8 @@ func (s *nudmService) SDMGetAmData(ue *amf_context.AmfUe) (problemDetails *model } } else { err = localErr - // API error - switch apiErr := localErr.(type){ + // API error + switch apiErr := localErr.(type) { case openapi.GenericOpenAPIError: switch errorModel := apiErr.Model().(type) { case Nudm_SubscriberDataManagement.GetAmDataError: