Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f928e9d5
authored
Nov 28, 2025
by
jason.mei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(aws): simplify HTTP status code extraction from AWS errors
parent
a925b8ec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
8 deletions
+4
-8
relay/channel/aws/relay-aws.go
+4
-8
No files found.
relay/channel/aws/relay-aws.go
View file @
f928e9d5
...
...
@@ -22,19 +22,15 @@ import (
"github.com/aws/aws-sdk-go-v2/credentials"
"github.com/aws/aws-sdk-go-v2/service/bedrockruntime"
bedrockruntimeTypes
"github.com/aws/aws-sdk-go-v2/service/bedrockruntime/types"
"github.com/aws/smithy-go"
"github.com/aws/smithy-go/auth/bearer"
)
// getAwsErrorStatusCode extracts HTTP status code from AWS SDK error
func
getAwsErrorStatusCode
(
err
error
)
int
{
var
apiErr
smithy
.
APIError
if
errors
.
As
(
err
,
&
apiErr
)
{
// Check for HTTP response error which contains status code
var
httpErr
interface
{
HTTPStatusCode
()
int
}
if
errors
.
As
(
err
,
&
httpErr
)
{
return
httpErr
.
HTTPStatusCode
()
}
// Check for HTTP response error which contains status code
var
httpErr
interface
{
HTTPStatusCode
()
int
}
if
errors
.
As
(
err
,
&
httpErr
)
{
return
httpErr
.
HTTPStatusCode
()
}
// Default to 500 if we can't determine the status code
return
http
.
StatusInternalServerError
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment