Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 30, 2024. It is now read-only.
/coder-v1-cliPublic archive

Commit11f797a

Browse files
author
Russtopia
committed
Reverted err response
1 parent5d92778 commit11f797a

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

‎internal/entclient/devurl.go

Lines changed: 10 additions & 8 deletions
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
typedelDevURLRequeststruct {
@@ -50,12 +48,14 @@ func (c Client) InsertDevURL(envID string, port int, name, access string) error
5048
Access:access,
5149
Name:name,
5250
})
53-
ifres!=nil&&res.StatusCode==http.StatusConflict {
54-
returnxerrors.Errorf("Failed to create devurl. Check that the port and name are unique.")
55-
}
5651
iferr!=nil {
5752
returnerr
5853
}
54+
55+
ifres.StatusCode!=http.StatusOK {
56+
returnbodyError(res)
57+
}
58+
5959
returnnil
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-
ifres!=nil&&res.StatusCode==http.StatusConflict {
81-
returnxerrors.Errorf("Failed to update devurl. Check that the port and name are unique.")
82-
}
8380
iferr!=nil {
8481
returnerr
8582
}
83+
84+
ifres.StatusCode!=http.StatusOK {
85+
returnbodyError(res)
86+
}
87+
8688
returnnil
8789
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp