You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'Access denied by Google. Please ensure the "Google Analytics Admin API" is enabled in your Google Cloud project and that your Google account has access to at least one GA4 property.',
174
+
)
175
+
}
176
+
177
+
if(!response.ok){
178
+
thrownewError(`Google API responded with status ${response.status}`)
179
+
}
180
+
181
+
constdata=awaitresponse.json()
169
182
constproperties: Ga4Property[]=[]
170
183
171
184
for(constaccountofdata.accountSummaries||[]){
@@ -179,13 +192,7 @@ export class Ga4ImportService {
179
192
180
193
returnproperties
181
194
}catch(error){
182
-
conststatus=error?.response?.status
183
-
if(status===403){
184
-
thrownewBadRequestException(
185
-
error?.response?.data?.error?.message||
186
-
'Access denied by Google. Please ensure the "Google Analytics Admin API" is enabled in your Google Cloud project and that your Google account has access to at least one GA4 property.',
187
-
)
188
-
}
195
+
if(errorinstanceofBadRequestException)throwerror
189
196
190
197
thrownewInternalServerErrorException(
191
198
'Failed to fetch Google Analytics properties. Please try again.',
0 commit comments