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