MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / isHTTP503Error

Function isHTTP503Error

agent/utils/ssl/acme.go:408–423  ·  view source on GitHub ↗

isHTTP503Error checks if an error is an HTTP 503 Service Unavailable error.

(err error)

Source from the content-addressed store, hash-verified

406
407// isHTTP503Error checks if an error is an HTTP 503 Service Unavailable error.
408func isHTTP503Error(err error) bool {
409 if err == nil {
410 return false
411 }
412
413 // Check for golang.org/x/crypto/acme.Error (used in manual_client.go).
414 var acmeErr *acme.Error
415 if errors.As(err, &acmeErr) {
416 return acmeErr.StatusCode == http.StatusServiceUnavailable
417 }
418
419 // Check error message for 503 (fallback for lego library errors).
420 errMsg := err.Error()
421 return strings.Contains(errMsg, "503") ||
422 strings.Contains(errMsg, "Service busy")
423}

Callers 2

ObtainSSLMethod · 0.85
ObtainIPSSLMethod · 0.85

Calls 1

ErrorMethod · 0.45

Tested by

no test coverage detected