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

Commit46146b9

Browse files
committed
chore: PR fixups, renames and comments
1 parent8d594a7 commit46146b9

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

‎coderd/dynamicparameters/error.go‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,13 @@ func TagValidationError(diags hcl.Diagnostics) *DiagnosticError {
2727
}
2828

2929
typeDiagnosticErrorstruct {
30-
Messagestring
31-
Diagnostics hcl.Diagnostics
30+
// Message is the human-readable message that will be returned to the user.
31+
Messagestring
32+
// Diagnostics are top level diagnostics that will be returned as "Detail" in the response.
33+
Diagnostics hcl.Diagnostics
34+
// KeyedDiagnostics translate to Validation errors in the response. A key could
35+
// be a parameter name, or a tag name. This allows diagnostics to be more closely
36+
// associated with a specific index/parameter/tag.
3237
KeyedDiagnosticsmap[string]hcl.Diagnostics
3338
}
3439

‎coderd/httpapi/httperror/responserror.go‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import (
66
"github.com/coder/coder/v2/codersdk"
77
)
88

9-
typeCoderSDKErrorinterface {
9+
typeResponderinterface {
1010
Response() (int, codersdk.Response)
1111
}
1212

13-
funcIsCoderSDKError(errerror) (CoderSDKError,bool) {
14-
varresponseErrCoderSDKError
13+
funcIsResponder(errerror) (Responder,bool) {
14+
varresponseErrResponder
1515
iferrors.As(err,&responseErr) {
1616
returnresponseErr,true
1717
}

‎coderd/httpapi/httperror/wsbuild.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
)
1010

1111
funcWriteWorkspaceBuildError(ctx context.Context,rw http.ResponseWriter,errerror) {
12-
ifresponseErr,ok:=IsCoderSDKError(err);ok {
12+
ifresponseErr,ok:=IsResponder(err);ok {
1313
code,resp:=responseErr.Response()
1414

1515
httpapi.Write(ctx,rw,code,resp)

‎coderd/wsbuilder/wsbuilder_test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,7 @@ func TestWsbuildError(t *testing.T) {
10101010
Message:msg,
10111011
}
10121012

1013-
respErr,ok:=httperror.IsCoderSDKError(buildErr)
1013+
respErr,ok:=httperror.IsResponder(buildErr)
10141014
require.True(t,ok,"should be a Coder SDK error")
10151015

10161016
code,resp:=respErr.Response()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp