When we get a 403 trying to get the telemetry document, assume we (#23631)

haven't opted into telemetry
This commit is contained in:
Brandon Kobel 2018-10-02 09:09:05 -07:00 committed by GitHub
parent 3d50ef741a
commit a839f7f403
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,6 +21,13 @@ export async function getTelemetryOptIn(request) {
if (savedObjectsClient.errors.isNotFoundError(error)) {
return null;
}
// if we aren't allowed to get the telemetry document, we can assume that we won't
// be able to opt into telemetry either, so we're returning `false` here instead of null
if (savedObjectsClient.errors.isForbiddenError(error)) {
return false;
}
throw error;
}
}