-
Notifications
You must be signed in to change notification settings - Fork 2.9k
fix: complete the missing international content #7769
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -99,13 +99,13 @@ func handleGetWithTransport(url string, transport *http.Transport) (*http.Respon | |
| return nil, buserr.WithMap("ErrHttpReqTimeOut", map[string]interface{}{"err": err.Error()}, err) | ||
| } else { | ||
| if strings.Contains(err.Error(), "no such host") { | ||
| return nil, buserr.New("ErrNoSuchHost") | ||
| return nil, buserr.WithErr("ErrNoSuchHost", errors.New("no such host")) | ||
| } | ||
| return nil, buserr.WithMap("ErrHttpReqFailed", map[string]interface{}{"err": err.Error()}, err) | ||
| } | ||
| } | ||
| if resp.StatusCode == 404 { | ||
| return nil, buserr.New("ErrHttpReqNotFound") | ||
| return nil, buserr.WithErr("ErrHttpReqNotFound", errors.New("no such resource")) | ||
| } | ||
|
|
||
| return resp, nil | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The code has no known irregularities. No issues or optimization suggestions were indicated during analysis of the given code snippet related to HTTP GET requests handling with timeouts using Go programming language (which is based on OpenAI's knowledge). This code snippet appears correct according to its current use case and does not require further modifications. However, if you are looking at other aspects like concurrency controls or performance optimizations without changing core functionality: For concurrency control purposes within goroutines, checking for context cancellation can help avoid unnecessary network calls in error recovery scenarios. Also look into more efficient timeouts than the provided example, such as custom timeouts defined within Regarding performance improvements, consider adding additional checks after timeouts to ensure they're due to timeout conditions; these could be non-existent, unexpected behavior, or server configuration changes that have no effect when expected. Note that while this code doesn't exhibit any obvious problems, it might benefit from careful review considering its broader function scope and how it interacts with the rest of system infrastructure including error contexts or response processing logic within handlers, services etc. |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot determine the specific difference or issue without reviewing all of your submitted code. However, I can suggest that you double-check if there's an inconsistency between message translation keys (
msgKey) and messages being constructed (res.Message). Additionally, ensure consistency across different parts of your program (e.g., functions withinErrorWithDetails).