Skip to content

Commit

Permalink
fix: fix lint err
Browse files Browse the repository at this point in the history
  • Loading branch information
tim1207 committed Nov 27, 2024
1 parent 84b6d72 commit 3980e4e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 29 deletions.
25 changes: 12 additions & 13 deletions internal/sbi/consumer/pcf_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ func (s *npcfService) AMPolicyControlCreate(
default:
return nil, openapi.ReportError("openapi error")
}

}
return nil, nil
}
Expand Down Expand Up @@ -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
Expand Down
28 changes: 14 additions & 14 deletions internal/sbi/consumer/smf_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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())
Expand Down
4 changes: 2 additions & 2 deletions internal/sbi/consumer/udm_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 3980e4e

Please sign in to comment.