@@ -60,6 +60,7 @@ import { AIConfigurationTracingOptions } from "./requestTracing/aiConfigurationT
6060import { KeyFilter , LabelFilter , SettingWatcher , SettingSelector , PagedSettingsWatcher , WatchedSetting } from "./types.js" ;
6161import { ConfigurationClientManager } from "./configurationClientManager.js" ;
6262import { getFixedBackoffDuration , getExponentialBackoffDuration } from "./common/backoffUtils.js" ;
63+ import { getStatusCode } from "./common/utils.js" ;
6364import { InvalidOperationError , ArgumentError , isFailoverableError , isInputError , SnapshotReferenceError } from "./common/errors.js" ;
6465import { ErrorMessages } from "./common/errorMessages.js" ;
6566
@@ -659,7 +660,7 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
659660
660661 const watcher : SettingWatcher = this . #sentinels. get ( watchedSetting ) ! ; // watcher should always exist for sentinels
661662 const isDeleted = response === undefined && watcher . etag !== undefined ; // previously existed, now deleted
662- const isChanged = response && Number ( response . statusCode ) === 200 && watcher . etag !== response . etag ; // etag changed
663+ const isChanged = response && getStatusCode ( response . statusCode ) === 200 && watcher . etag !== response . etag ; // etag changed
663664 if ( isDeleted || isChanged ) {
664665 changedSentinel = watchedSetting ;
665666 changedSentinelWatcher = { etag : isChanged ? response . etag : undefined } ;
@@ -750,7 +751,7 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
750751
751752 for await ( const page of pageIterator ) {
752753 // when conditional request is sent, the response will be 304 if not changed
753- if ( Number ( page . _response . status ) === 200 ) { // created or changed
754+ if ( getStatusCode ( page . _response . status ) === 200 ) { // created or changed
754755 return true ;
755756 }
756757 }
@@ -779,7 +780,7 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
779780 try {
780781 response = await this . #executeWithFailoverPolicy( funcToExecute ) ;
781782 } catch ( error ) {
782- if ( isRestError ( error ) && Number ( error . statusCode ) === 404 ) {
783+ if ( isRestError ( error ) && getStatusCode ( error . statusCode ) === 404 ) {
783784 response = undefined ;
784785 } else {
785786 throw error ;
@@ -822,7 +823,7 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
822823 try {
823824 response = await this . #executeWithFailoverPolicy( funcToExecute ) ;
824825 } catch ( error ) {
825- if ( isRestError ( error ) && Number ( error . statusCode ) === 404 ) {
826+ if ( isRestError ( error ) && getStatusCode ( error . statusCode ) === 404 ) {
826827 response = undefined ;
827828 } else {
828829 throw error ;
0 commit comments