Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit 11f797a

Browse files
author
Russtopia
committed
Reverted err response
1 parent 5d92778 commit 11f797a

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

Diff for: internal/entclient/devurl.go

+10-8
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ package entclient
33
import (
44
"fmt"
55
"net/http"
6-
7-
"golang.org/x/xerrors"
86
)
97

108
type delDevURLRequest struct {
@@ -50,12 +48,14 @@ func (c Client) InsertDevURL(envID string, port int, name, access string) error
5048
Access: access,
5149
Name: name,
5250
})
53-
if res != nil && res.StatusCode == http.StatusConflict {
54-
return xerrors.Errorf("Failed to create devurl. Check that the port and name are unique.")
55-
}
5651
if err != nil {
5752
return err
5853
}
54+
55+
if res.StatusCode != http.StatusOK {
56+
return bodyError(res)
57+
}
58+
5959
return nil
6060
}
6161

@@ -77,11 +77,13 @@ func (c Client) UpdateDevURL(envID, urlID string, port int, name, access string)
7777
Access: access,
7878
Name: name,
7979
})
80-
if res != nil && res.StatusCode == http.StatusConflict {
81-
return xerrors.Errorf("Failed to update devurl. Check that the port and name are unique.")
82-
}
8380
if err != nil {
8481
return err
8582
}
83+
84+
if res.StatusCode != http.StatusOK {
85+
return bodyError(res)
86+
}
87+
8688
return nil
8789
}

0 commit comments

Comments
 (0)