Skip to content

Commit

Permalink
chore: fixed conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
yusinto committed Sep 19, 2023
1 parent 55f8e72 commit 37b33fb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 4 additions & 1 deletion packages/shared/common/src/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ export class LDFileDataSourceError extends Error {
}

export class LDPollingError extends Error {
constructor(message: string) {
public readonly status?: number;

constructor(message: string, status?: number) {
super(message);
this.status = status;
this.name = 'LaunchDarklyPollingError';
}
}
Expand Down
3 changes: 2 additions & 1 deletion packages/shared/sdk-server/src/LDClientImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
subsystem,
} from '@launchdarkly/js-sdk-common';

import { LDClient, LDFlagsState, LDFlagsStateOptions, LDOptions } from './api';
import { LDClient, LDFeatureStore, LDFlagsState, LDFlagsStateOptions, LDOptions } from './api';
import { BigSegmentStoreMembership } from './api/interfaces';
import BigSegmentsManager from './BigSegmentsManager';
import BigSegmentStoreStatusProvider from './BigSegmentStatusProviderImpl';
Expand All @@ -40,6 +40,7 @@ import Configuration from './options/Configuration';
import { AsyncStoreFacade } from './store';
import VersionedDataKinds from './store/VersionedDataKinds';

const { NullEventProcessor } = internal;
enum InitState {
Initializing,
Initialized,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,11 @@ export default class PollingProcessor implements subsystem.LDStreamProcessor {

this.logger?.debug('Elapsed: %d ms, sleeping for %d ms', elapsed, sleepFor);
if (err) {
if (err.status && !isHttpRecoverable(err.status)) {
const { status } = err;
if (status && !isHttpRecoverable(status)) {
const message = httpErrorMessage(err, 'polling request');
this.logger?.error(message);
this.errorHandler?.(new LDPollingError(message));
this.errorHandler?.(new LDPollingError(message, status));
// It is not recoverable, return and do not trigger another
// poll.
return;
Expand Down

0 comments on commit 37b33fb

Please sign in to comment.