-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
If ClientKey is wrong then code below throws exception
var context = new Context()
{
Enabled = true,
ClientKey = SDKConnectionClientKey,
Attributes = attrs,
LoggerFactory = loggerFactory
};
var featureFlags = new GrowthBook.GrowthBook(context);
var task = featureFlags.LoadFeatures();
task.Wait();
featureFlags.IsOn("AdvancedMode");
Error log below:
dbug: GrowthBook.Api.FeatureRefreshWorker[0]
Features GrowthBook API endpoint: 'https://cdn.growthbook.io/api/features/sdk-****'
dbug: GrowthBook.Api.FeatureRefreshWorker[0]
Features GrowthBook API endpoint (Server Sent Events): 'https://cdn.growthbook.io/api/features/sdk-****'
info: GrowthBook.GrowthBook[0]
Loading features from the repository
info: GrowthBook.Api.FeatureRepository[0]
Getting features from repository, verifying cache expiration and option to force refresh
info: GrowthBook.Api.FeatureRepository[0]
Cache has expired or option to force refresh was set, refreshing the cache from the API
dbug: GrowthBook.Api.FeatureRepository[0]
Cache expired: 'True' and option to force refresh: '(null)'
info: GrowthBook.Api.FeatureRefreshWorker[0]
Making an HTTP request to the default Features API endpoint 'https://cdn.growthbook.io/api/features/sdk-****'
info: GrowthBook.Api.FeatureRepository[0]
Either cache currently has no features or the option to wait for completion was set, waiting for cache to refresh
dbug: GrowthBook.Api.FeatureRepository[0]
Feature count: '0' and option to wait for completion: '(null)'
fail: GrowthBook.Api.FeatureRefreshWorker[0]
HTTP request to default Features API endpoint 'https://cdn.growthbook.io/api/features/sdk-****' resulted in a BadRequest status code
info: GrowthBook.GrowthBook[0]
Loading features has completed, retrieved '' features
fail: GrowthBook.GrowthBook[0]
Encountered an unhandled exception while executing 'EvalFeature'
System.NullReferenceException: Object reference not set to an instance of an object.
at GrowthBook.GrowthBook.EvalFeature(String featureId)
Other then that, there is no way to determine was LoadFeatures successful or not. No result code, no error code, nothing :(
Metadata
Metadata
Assignees
Labels
No labels