From 8ea58b9586f766f5bbddcb8c7592a192df3b3e01 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Sat, 13 Jul 2024 01:31:02 -0700 Subject: [PATCH] fixed typo, env, and err msg --- packages/node/src/local/cohort/cohort-api.ts | 4 +++- packages/node/src/local/updater.ts | 2 +- packages/node/test/local/client.eu.test.ts | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/node/src/local/cohort/cohort-api.ts b/packages/node/src/local/cohort/cohort-api.ts index 5c009f1..95d1f76 100644 --- a/packages/node/src/local/cohort/cohort-api.ts +++ b/packages/node/src/local/cohort/cohort-api.ts @@ -73,7 +73,9 @@ export class SdkCohortApi implements CohortApi { } else if (response.status == 413) { throw Error(`Cohort error response: size > ${options.maxCohortSize}`); } else { - throw Error(`Cohort error resposne: status=${response.status}`); + throw Error( + `Cohort error response: status ${response.status}, body ${response.body}`, + ); } } } diff --git a/packages/node/src/local/updater.ts b/packages/node/src/local/updater.ts index e50d2ed..1783865 100644 --- a/packages/node/src/local/updater.ts +++ b/packages/node/src/local/updater.ts @@ -116,7 +116,7 @@ export class FlagConfigUpdaterBase { }) .catch((err) => { this.logger.warn( - `[Experiment] Cohort download failed ${cohortId}, using existing cohort`, + `[Experiment] Cohort download failed ${cohortId}, using existing cohort if exist`, err, ); failedCohortIds.add(cohortId); diff --git a/packages/node/test/local/client.eu.test.ts b/packages/node/test/local/client.eu.test.ts index 738912f..12a49ae 100644 --- a/packages/node/test/local/client.eu.test.ts +++ b/packages/node/test/local/client.eu.test.ts @@ -5,7 +5,7 @@ import { Experiment } from 'src/factory'; dotenv.config({ path: path.join(__dirname, '../../', '.env') }); -if (!process.env['API_KEY'] && !process.env['SECRET_KEY']) { +if (!process.env['EU_API_KEY'] && !process.env['EU_SECRET_KEY']) { throw new Error( 'No env vars found. If running on local, have you created .env file correct environment variables? Checkout README.md', );