Skip to content

Commit fb5a3de

Browse files
committed
address try/catch comment
1 parent 216b3ac commit fb5a3de

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/data-connect/data-connect-api-client-internal.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,13 @@ export class DataConnectApiClient {
136136
...(options?.impersonate && { extensions: { impersonate: options?.impersonate } }),
137137
};
138138
const url = await this.getUrl(API_VERSION, this.connectorConfig.location, this.connectorConfig.serviceId, endpoint);
139-
return this.makeGqlRequest<GraphqlResponse>(url, data)
140-
.then((resp) => {
141-
return resp;
142-
})
143-
.catch((err) => {
144-
throw this.toFirebaseError(err);
145-
});
139+
140+
try {
141+
const resp = await this.makeGqlRequest<GraphqlResponse>(url, data);
142+
return resp;
143+
} catch (err: any) {
144+
throw this.toFirebaseError(err);
145+
}
146146
}
147147

148148
/**
@@ -216,13 +216,13 @@ export class DataConnectApiClient {
216216
endpoint,
217217
this.connectorConfig.connector,
218218
);
219-
return this.makeGqlRequest<GraphqlResponse>(url, data)
220-
.then((resp) => {
221-
return resp;
222-
})
223-
.catch((err) => {
224-
throw this.toFirebaseError(err);
225-
});
219+
220+
try {
221+
const resp = await this.makeGqlRequest<GraphqlResponse>(url, data);
222+
return resp;
223+
} catch (err: any) {
224+
throw this.toFirebaseError(err);
225+
}
226226
}
227227

228228
/**

0 commit comments

Comments
 (0)