@@ -20,7 +20,7 @@ async function getGeolocationConfig(
20
20
} )
21
21
22
22
if ( ! res . ok ) {
23
- throw new Error ( `geolocation config: fetch failed ${ res . status } ` )
23
+ throw new Error ( `config: fetch failed ${ res . status } ` )
24
24
}
25
25
26
26
const json = await res . json ( )
@@ -35,7 +35,7 @@ async function getGeolocationConfig(
35
35
ageRestrictedGeos : json . ageRestrictedGeos ?? [ ] ,
36
36
ageBlockedGeos : json . ageBlockedGeos ?? [ ] ,
37
37
}
38
- logger . debug ( `geolocation config: success` )
38
+ logger . debug ( `config: success` )
39
39
return config
40
40
} else {
41
41
return undefined
@@ -85,7 +85,7 @@ export function beginResolveGeolocationConfig() {
85
85
} catch ( e : any ) {
86
86
success = false
87
87
88
- logger . debug ( `geolocation config: failed initial request` , {
88
+ logger . debug ( `config: failed initial request` , {
89
89
safeMessage : e . message ,
90
90
} )
91
91
@@ -101,12 +101,12 @@ export function beginResolveGeolocationConfig() {
101
101
success = true
102
102
} else {
103
103
// endpoint should throw on all failures, this is insurance
104
- throw new Error ( `geolocation config: nothing returned from retries` )
104
+ throw new Error ( `config: nothing returned from retries` )
105
105
}
106
106
} )
107
107
. catch ( ( e : any ) => {
108
108
// complete fail closed
109
- logger . debug ( `geolocation config: failed retries` , {
109
+ logger . debug ( `config: failed retries` , {
110
110
safeMessage : e . message ,
111
111
} )
112
112
} )
@@ -123,21 +123,19 @@ export function beginResolveGeolocationConfig() {
123
123
*/
124
124
export async function ensureGeolocationConfigIsResolved ( ) {
125
125
if ( ! geolocationConfigResolution ) {
126
- throw new Error (
127
- `geolocation config: beginResolveGeolocationConfig not called yet` ,
128
- )
126
+ throw new Error ( `config: beginResolveGeolocationConfig not called yet` )
129
127
}
130
128
131
129
const cached = device . get ( [ 'geolocation' ] )
132
130
if ( cached ) {
133
- logger . debug ( `geolocation config: using cache` )
131
+ logger . debug ( `config: using cache` )
134
132
} else {
135
- logger . debug ( `geolocation config: no cache` )
133
+ logger . debug ( `config: no cache` )
136
134
const { success} = await geolocationConfigResolution
137
135
if ( success ) {
138
- logger . debug ( `geolocation config: resolved` )
136
+ logger . debug ( `config: resolved` )
139
137
} else {
140
- logger . info ( `geolocation config: failed to resolve` )
138
+ logger . info ( `config: failed to resolve` )
141
139
}
142
140
}
143
141
}
0 commit comments