Skip to content
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

Handle Fastly API unresponsiveness Errors on Authentication #1211

Closed
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pkg/app/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,11 @@
if err != nil {
return nil, fmt.Errorf("failed to request OpenID Connect .well-known metadata (%s): %w", metadataEndpoint, err)
}
// Set a more meaningful error message when Fastly servers are unresponsive
// check if the response code is a 500 or above
if resp.StatusCode >= 500 {
Integralist marked this conversation as resolved.
Show resolved Hide resolved
return nil, fmt.Errorf("Fastly servers are unresponsive, please check the Status Page (https://fastlystatus.com) and reach out to support if the error persists — More Details: (HTTP Status Code: %d, Error Message: %s)", resp.StatusCode, resp.Body)

Check failure on line 661 in pkg/app/run.go

View workflow job for this annotation

GitHub Actions / lint

error strings should not be capitalized (ST1005)
Integralist marked this conversation as resolved.
Show resolved Hide resolved
}

openIDConfig, err := io.ReadAll(resp.Body)
if err != nil {
Expand Down
Loading