Skip to content

Commit db69e01

Browse files
fix: move UserError to request lib
1 parent cd47af1 commit db69e01

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

lib/shared/config-manager/src/index.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { DVCLogger } from '@devcycle/types'
2-
// import { UserError } from './utils/userError'
32
import { getEnvironmentConfig } from './request'
43
import { DevCycleOptions } from '@devcycle/js-cloud-server-sdk'
5-
import { ResponseError } from '@devcycle/server-request'
4+
import { ResponseError, UserError } from '@devcycle/server-request'
65

76
type ConfigPollingOptions = DevCycleOptions & {
87
cdnURI?: string
@@ -151,8 +150,7 @@ export class EnvironmentConfigManager {
151150
)
152151
} else if (responseError?.status === 403) {
153152
this.stopPolling()
154-
// UserError
155-
throw new Error(`Invalid SDK key provided: ${this.sdkKey}`)
153+
throw new UserError(`Invalid SDK key provided: ${this.sdkKey}`)
156154
} else {
157155
throw new Error('Failed to download DevCycle config.')
158156
}

lib/shared/server-request/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import fetchWithRetry, { RequestInitWithRetry } from 'fetch-retry'
22

3+
export * from './userError'
4+
35
export class ResponseError extends Error {
46
constructor(message: string) {
57
super(message)
File renamed without changes.

sdk/nodejs/src/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import {
1717
VariableTypeAlias,
1818
} from '@devcycle/types'
1919
import os from 'os'
20-
import { UserError } from './utils/userError'
2120
import {
2221
DevCycleUser,
2322
DVCVariable,
@@ -31,6 +30,7 @@ import {
3130
DevCycleEvent,
3231
} from '@devcycle/js-cloud-server-sdk'
3332
import { DVCPopulatedUserFromDevCycleUser } from './models/populatedUserHelpers'
33+
import { UserError } from '@devcycle/server-request'
3434

3535
interface IPlatformData {
3636
platform: string

0 commit comments

Comments
 (0)