fix: fix aws claude panic (#1384)
This commit is contained in:
parent
7e027d2bd0
commit
1f76c80553
@ -53,6 +53,16 @@ func (e GeneralErrorResponse) ToMessage() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func RelayErrorHandler(resp *http.Response) (ErrorWithStatusCode *model.ErrorWithStatusCode) {
|
func RelayErrorHandler(resp *http.Response) (ErrorWithStatusCode *model.ErrorWithStatusCode) {
|
||||||
|
if resp == nil {
|
||||||
|
return &model.ErrorWithStatusCode{
|
||||||
|
StatusCode: 500,
|
||||||
|
Error: model.Error{
|
||||||
|
Message: "resp is nil",
|
||||||
|
Type: "upstream_error",
|
||||||
|
Code: "bad_response",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
ErrorWithStatusCode = &model.ErrorWithStatusCode{
|
ErrorWithStatusCode = &model.ErrorWithStatusCode{
|
||||||
StatusCode: resp.StatusCode,
|
StatusCode: resp.StatusCode,
|
||||||
Error: model.Error{
|
Error: model.Error{
|
||||||
|
@ -208,6 +208,9 @@ func getMappedModelName(modelName string, mapping map[string]string) (string, bo
|
|||||||
|
|
||||||
func isErrorHappened(meta *meta.Meta, resp *http.Response) bool {
|
func isErrorHappened(meta *meta.Meta, resp *http.Response) bool {
|
||||||
if resp == nil {
|
if resp == nil {
|
||||||
|
if meta.ChannelType == channeltype.AwsClaude {
|
||||||
|
return false
|
||||||
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
if resp.StatusCode != http.StatusOK {
|
if resp.StatusCode != http.StatusOK {
|
||||||
|
Loading…
Reference in New Issue
Block a user