mirror of
https://github.com/Ed1s0nZ/CyberStrikeAI.git
synced 2026-08-01 00:27:35 +02:00
Add files via upload
This commit is contained in:
@@ -60,6 +60,7 @@ func isEinoTransientRunError(err error) bool {
|
||||
"bad gateway",
|
||||
"gateway timeout",
|
||||
"internal server error",
|
||||
"unexpected internal error",
|
||||
"connection reset",
|
||||
"connection refused",
|
||||
"connection closed",
|
||||
@@ -72,6 +73,7 @@ func isEinoTransientRunError(err error) bool {
|
||||
"dial tcp",
|
||||
"tls handshake timeout",
|
||||
"stream error",
|
||||
"failed to receive stream chunk",
|
||||
"goaway", // http2: server sent GOAWAY and closed the connection
|
||||
"unexpected eof",
|
||||
`": eof`, // net/http: Post "url": EOF (often wraps io.EOF)
|
||||
@@ -136,7 +138,8 @@ func einoTransientRunErrorUserDetail(err error) (kind, summary string) {
|
||||
case strings.Contains(lower, "overloaded") ||
|
||||
strings.Contains(lower, "capacity") ||
|
||||
strings.Contains(lower, "temporarily unavailable") ||
|
||||
strings.Contains(lower, "service unavailable"):
|
||||
strings.Contains(lower, "service unavailable") ||
|
||||
strings.Contains(lower, "unexpected internal error"):
|
||||
kind = "upstream_busy"
|
||||
case strings.Contains(lower, "connection reset") ||
|
||||
strings.Contains(lower, "connection refused") ||
|
||||
@@ -153,6 +156,7 @@ func einoTransientRunErrorUserDetail(err error) (kind, summary string) {
|
||||
strings.Contains(lower, "unexpected eof"):
|
||||
kind = "network"
|
||||
case strings.Contains(lower, "stream error") ||
|
||||
strings.Contains(lower, "failed to receive stream chunk") ||
|
||||
strings.Contains(lower, "unexpected end of json"):
|
||||
kind = "stream"
|
||||
default:
|
||||
|
||||
@@ -34,6 +34,7 @@ func TestIsEinoTransientRunError(t *testing.T) {
|
||||
{"rate limit", errors.New(`{"error":"rate limit exceeded"}`), true},
|
||||
{"connection reset", errors.New("read tcp: connection reset by peer"), true},
|
||||
{"http2 goaway", errors.New("failed to receive stream chunk: error, http2: server sent GOAWAY and closed the connection; LastStreamID=791, ErrCode=NO_ERROR"), true},
|
||||
{"unexpected internal stream chunk", errors.New("failed to receive stream chunk: error, The service encountered an unexpected internal error. Request id: 0217851391106464f01ec66621d0980a42fd45436ed75957a6a0a"), true},
|
||||
{"unexpected eof", errors.New("unexpected EOF"), true},
|
||||
{"503", errors.New("upstream returned 503"), true},
|
||||
{"iteration limit", errors.New("max iteration reached"), false},
|
||||
@@ -74,6 +75,7 @@ func TestEinoTransientRunErrorUserDetail(t *testing.T) {
|
||||
{"upstream", errors.New("upstream returned 503"), "upstream_server"},
|
||||
{"network", errors.New("read tcp: connection reset by peer"), "network"},
|
||||
{"stream", errors.New("unexpected end of JSON"), "stream"},
|
||||
{"stream chunk", errors.New("failed to receive stream chunk: error, The service encountered an unexpected internal error. Request id: abc"), "upstream_busy"},
|
||||
}
|
||||
for _, tc := range cases {
|
||||
tc := tc
|
||||
|
||||
Reference in New Issue
Block a user