diff options
author | Amy Qualls <aqualls@gitlab.com> | 2023-05-15 20:23:58 +0300 |
---|---|---|
committer | Amy Qualls <aqualls@gitlab.com> | 2023-05-15 20:23:58 +0300 |
commit | ae48b3679f0923e78cca9fd4528bb0e957c90999 (patch) | |
tree | 9138e00c4359dd97dad49ee981db30f7a7fc267a | |
parent | 0b0e46fe69e9b94e3def2a9318188fcc0f3f00c6 (diff) |
Turn the error into a full sentenceaqualls-improve-custom-hooks-message
Start with "Error:" and make the rest of the error message a
complete sentence. It needs more info, but let's start somewhere.
-rw-r--r-- | internal/gitaly/service/operations/commit_files.go | 2 | ||||
-rw-r--r-- | internal/gitaly/service/operations/commit_files_test.go | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/internal/gitaly/service/operations/commit_files.go b/internal/gitaly/service/operations/commit_files.go index 24f376801..6063a1137 100644 --- a/internal/gitaly/service/operations/commit_files.go +++ b/internal/gitaly/service/operations/commit_files.go @@ -80,7 +80,7 @@ func (s *Server) UserCommitFiles(stream gitalypb.OperationService_UserCommitFile }, ) case errors.As(err, &customHookErr): - return structerr.NewPermissionDenied("denied by custom hooks").WithDetail( + return structerr.NewPermissionDenied("Error: Denied by custom hooks.").WithDetail( &gitalypb.UserCommitFilesError{ Error: &gitalypb.UserCommitFilesError_CustomHook{ CustomHook: customHookErr.Proto(), diff --git a/internal/gitaly/service/operations/commit_files_test.go b/internal/gitaly/service/operations/commit_files_test.go index b2293d3c8..b68579a9f 100644 --- a/internal/gitaly/service/operations/commit_files_test.go +++ b/internal/gitaly/service/operations/commit_files_test.go @@ -1054,7 +1054,7 @@ func TestUserCommitFilesQuarantine(t *testing.T) { require.NoError(t, stream.Send(actionContentRequest("content"))) _, err = stream.CloseAndRecv() - testhelper.RequireGrpcError(t, structerr.NewPermissionDenied("denied by custom hooks").WithDetail( + testhelper.RequireGrpcError(t, structerr.NewPermissionDenied("Error: Denied by custom hooks.").WithDetail( &gitalypb.UserCommitFilesError{ Error: &gitalypb.UserCommitFilesError_CustomHook{ CustomHook: &gitalypb.CustomHookError{ @@ -1498,7 +1498,7 @@ func TestFailedUserCommitFilesRequestDueToHooks(t *testing.T) { expectedOut := fmt.Sprintf("GL_ID=%s GL_USERNAME=%s\n", gittest.TestUser.GlId, gittest.TestUser.GlUsername) - testhelper.RequireGrpcError(t, structerr.NewPermissionDenied("denied by custom hooks").WithDetail( + testhelper.RequireGrpcError(t, structerr.NewPermissionDenied("Error: Denied by custom hooks.").WithDetail( &gitalypb.UserCommitFilesError{ Error: &gitalypb.UserCommitFilesError_CustomHook{ CustomHook: &gitalypb.CustomHookError{ |