Skip to content

Commit 03a377e

Browse files
committed
docs: standardize error message terminology for API key helper
- Fix typo in error messages: change "timed out" to "timeout" for api_key_helper command errors Signed-off-by: Bo-Yi Wu <[email protected]>
1 parent 6394674 commit 03a377e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

util/api_key_helper_unix.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func GetAPIKeyFromHelper(ctx context.Context, helperCmd string) (string, error)
7474
if cmd.Process == nil {
7575
// Process handle not initialized; wait for cleanup and report timeout
7676
<-done
77-
return "", fmt.Errorf("api_key_helper command timed out after %v", HelperTimeout)
77+
return "", fmt.Errorf("api_key_helper command timeout after %v", HelperTimeout)
7878
}
7979
pgid := cmd.Process.Pid
8080

@@ -86,13 +86,13 @@ func GetAPIKeyFromHelper(ctx context.Context, helperCmd string) (string, error)
8686
case <-done:
8787
// Process exited after timeout was reached; treat as timeout regardless of exit status.
8888
// We intentionally ignore stdout/stderr here to avoid returning a key after a timeout.
89-
return "", fmt.Errorf("api_key_helper command timed out after %v", HelperTimeout)
89+
return "", fmt.Errorf("api_key_helper command timeout after %v", HelperTimeout)
9090

9191
case <-time.After(2 * time.Second):
9292
// Grace period expired: send SIGKILL to force termination
9393
_ = syscall.Kill(-pgid, syscall.SIGKILL)
9494
<-done // Wait for cleanup
95-
return "", fmt.Errorf("api_key_helper command timed out after %v", HelperTimeout)
95+
return "", fmt.Errorf("api_key_helper command timeout after %v", HelperTimeout)
9696
}
9797
}
9898
}

util/api_key_helper_windows.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,6 @@ func GetAPIKeyFromHelper(ctx context.Context, helperCmd string) (string, error)
143143
// Timeout: terminate the entire Job (all descendants)
144144
_ = windows.TerminateJobObject(job, 1)
145145
<-done // Wait for cleanup
146-
return "", fmt.Errorf("api_key_helper command timed out after %v", HelperTimeout)
146+
return "", fmt.Errorf("api_key_helper command timeout after %v", HelperTimeout)
147147
}
148148
}

0 commit comments

Comments
 (0)