Skip to content

Commit

Permalink
[chore] update error handler when deleting server
Browse files Browse the repository at this point in the history
  • Loading branch information
cuongpiger committed Oct 13, 2024
1 parent 922bd2a commit 0272926
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/lb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ func TestUpdateListenerSuccess(t *ltesting.T) {

func TestListListenersByLoadBalancerId(t *ltesting.T) {
vngcloud := validSdkConfig()
opt := lslbv2.NewListListenersByLoadBalancerIdRequest("lb-8bd4ea07-ab40-483d-8387-124ed2f2cecb")
opt := lslbv2.NewListListenersByLoadBalancerIdRequest("lb-1d3a92bb-6ebd-4b19-ad4b-5f47f5953144")
listeners, sdkerr := vngcloud.VLBGateway().V2().LoadBalancerService().ListListenersByLoadBalancerId(opt)
if sdkerr != nil {
t.Fatalf("Expect nil but got %+v", sdkerr)
Expand All @@ -403,7 +403,7 @@ func TestListListenersByLoadBalancerId(t *ltesting.T) {
t.Fatalf("Expect not nil but got nil")
}

t.Log("Result: ", listeners)
t.Log("Result: ", listeners.At(0).DefaultPoolId)
t.Log("PASS")
}

Expand Down
1 change: 1 addition & 0 deletions vngcloud/services/compute/v2/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ func (s *ComputeServiceV2) DeleteServerById(popts IDeleteServerByIdRequest) lser
if _, sdkErr := s.VServerClient.Delete(url, req); sdkErr != nil {
return lserr.SdkErrorHandler(sdkErr, errResp,
lserr.WithErrorServerNotFound(errResp),
lserr.WithErrorVolumeInProcess(errResp),
lserr.WithErrorServerDeleteDeletingServer(errResp),
lserr.WithErrorServerDeleteBillingServer(errResp),
lserr.WithErrorServerDeleteCreatingServer(errResp),
Expand Down

0 comments on commit 0272926

Please sign in to comment.