Skip to content

Commit

Permalink
Fix/revert browser field (#115)
Browse files Browse the repository at this point in the history
* fix: remove browser field

* fix: do not emit error for 304
  • Loading branch information
FredrikOseberg committed Sep 23, 2022
1 parent 8ad5707 commit 516660a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"description": "A browser client that can be used together with the unleash-proxy.",
"main": "./build/index.js",
"types": "./build/index.d.ts",
"browser": "./build/main.min.js",
"files": [
"build",
"examples",
Expand Down
11 changes: 8 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,9 +368,14 @@ export class UnleashClient extends TinyEmitter {
this.emit(EVENTS.READY);
this.readyEventEmitted = true;
}
} else if (!response.ok) {
console.error('Unleash: Fetching feature toggles did not have an ok response');
this.emit(EVENTS.ERROR, { type: 'HttpError', code: response.status })
} else if (!response.ok && response.status !== 304) {
console.error(
'Unleash: Fetching feature toggles did not have an ok response'
);
this.emit(EVENTS.ERROR, {
type: 'HttpError',
code: response.status,
});
}
} catch (e) {
console.error('Unleash: unable to fetch feature toggles', e);
Expand Down

0 comments on commit 516660a

Please sign in to comment.