mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 08:58:41 +00:00
Updated error messages verifying DigiCert profile. (#27342)
For #26622 Updating DigiCert error messages after discussion with Gabe.
This commit is contained in:
parent
c0dcf686cc
commit
49d4c1f7d2
1 changed files with 8 additions and 1 deletions
|
|
@ -77,7 +77,14 @@ func (s *Service) VerifyProfileID(ctx context.Context, config fleet.DigiCertInte
|
|||
}
|
||||
defer resp.Body.Close()
|
||||
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
switch resp.StatusCode {
|
||||
case http.StatusOK:
|
||||
// all good
|
||||
case http.StatusUnauthorized:
|
||||
return ctxerr.Errorf(ctx, "most likely invalid API token; status code: %d", resp.StatusCode)
|
||||
case http.StatusForbidden:
|
||||
return ctxerr.Errorf(ctx, "most likely invalid profile GUID; status code: %d", resp.StatusCode)
|
||||
default:
|
||||
return ctxerr.Errorf(ctx, "unexpected DigiCert status code: %d", resp.StatusCode)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue