-
Notifications
You must be signed in to change notification settings - Fork 31
feat: adds datasource status to sdk-client #590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
60aae7c
feat: adds datasource status to sdk-client
tanderson-ld 7ef3b5c
self review comments
tanderson-ld 6ef2c49
lint issues
tanderson-ld 2849c1f
Merge remote-tracking branch 'origin' into ta/sc-249239/data-source-s…
tanderson-ld 6f8c6b5
fixing missing identify resolve
tanderson-ld ff6dda5
removing unused StoreError
tanderson-ld c4879f5
updated datasource states. shutdown to be closed and now closed and …
tanderson-ld d95111f
making change detection tests a little less sensitive
tanderson-ld 1c584d3
Merge remote-tracking branch 'origin' into ta/sc-249239/data-source-s…
tanderson-ld 6028c89
now passing emitter to DataSourceStatusManager and fixing related tests
tanderson-ld 90bbc69
linting
tanderson-ld a2787a6
fixing lint and incorrect commenting in test
tanderson-ld ae3f473
fixing missed merge logic and fixing unit tests
tanderson-ld 1c24e1b
remove unused import
tanderson-ld 8dd7590
Merge branch 'main' into ta/sc-249239/data-source-status-rebase
tanderson-ld 47b6b70
fixing imports wip
tanderson-ld ddeb130
Fix build.
kinyoklion 60ce6c5
Fix common tests.
kinyoklion 7df3547
Merge branch 'main' into ta/sc-249239/data-source-status-rebase
kinyoklion 15adf36
tidy
kinyoklion 11e430c
Browser initializing from poll.
kinyoklion df41f81
Add error handling for single poll.
kinyoklion 57796af
Documentation and string enum.
kinyoklion File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
packages/shared/common/src/datasource/DataSourceErrorKinds.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| export enum DataSourceErrorKind { | ||
| /// An unexpected error, such as an uncaught exception, further | ||
| /// described by the error message. | ||
| Unknown = 'UNKNOWN', | ||
|
|
||
| /// An I/O error such as a dropped connection. | ||
| NetworkError = 'NETWORK_ERROR', | ||
|
|
||
| /// The LaunchDarkly service returned an HTTP response with an error | ||
| /// status, available in the status code. | ||
| ErrorResponse = 'ERROR_RESPONSE', | ||
|
|
||
| /// The SDK received malformed data from the LaunchDarkly service. | ||
| InvalidData = 'INVALID_DATA', | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| /* eslint-disable max-classes-per-file */ | ||
| import { DataSourceErrorKind } from './DataSourceErrorKinds'; | ||
|
|
||
| export class LDFileDataSourceError extends Error { | ||
| constructor(message: string) { | ||
| super(message); | ||
| this.name = 'LaunchDarklyFileDataSourceError'; | ||
| } | ||
| } | ||
|
|
||
| export class LDPollingError extends Error { | ||
| public readonly kind: DataSourceErrorKind; | ||
| public readonly status?: number; | ||
| public readonly recoverable: boolean; | ||
|
|
||
| constructor(kind: DataSourceErrorKind, message: string, status?: number, recoverable = true) { | ||
| super(message); | ||
| this.kind = kind; | ||
| this.status = status; | ||
| this.name = 'LaunchDarklyPollingError'; | ||
| this.recoverable = recoverable; | ||
| } | ||
| } | ||
|
|
||
| export class LDStreamingError extends Error { | ||
| public readonly kind: DataSourceErrorKind; | ||
| public readonly code?: number; | ||
| public readonly recoverable: boolean; | ||
|
|
||
| constructor(kind: DataSourceErrorKind, message: string, code?: number, recoverable = true) { | ||
| super(message); | ||
| this.kind = kind; | ||
| this.code = code; | ||
| this.name = 'LaunchDarklyStreamingError'; | ||
| this.recoverable = recoverable; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| import { DataSourceErrorKind } from './DataSourceErrorKinds'; | ||
| import { LDFileDataSourceError, LDPollingError, LDStreamingError } from './errors'; | ||
|
|
||
| export { DataSourceErrorKind, LDFileDataSourceError, LDPollingError, LDStreamingError }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| export * from './context'; | ||
| export * from './diagnostics'; | ||
| export * from './evaluation'; | ||
| export * from './events'; | ||
| export * from './stream'; | ||
| export * from './context'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| import { LDStreamingError } from '../../errors'; | ||
| import { LDStreamingError } from '../../datasource/errors'; | ||
|
|
||
| export type StreamingErrorHandler = (err: LDStreamingError) => void; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For reviewers: These moved to datasource/errors.ts