mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
add error throwing to method
This commit is contained in:
@@ -120,6 +120,8 @@ export class ApiBasedRepositoryLoader {
|
|||||||
formData.set("json", JSON.stringify(formDataJsonObject));
|
formData.set("json", JSON.stringify(formDataJsonObject));
|
||||||
|
|
||||||
const query = new URLSearchParams(params).toString();
|
const query = new URLSearchParams(params).toString();
|
||||||
|
|
||||||
|
try {
|
||||||
const response = await fetch(`${this.baseUrl}?${query}`, {
|
const response = await fetch(`${this.baseUrl}?${query}`, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: formData,
|
body: formData,
|
||||||
@@ -129,6 +131,10 @@ export class ApiBasedRepositoryLoader {
|
|||||||
await this.updateStopDataForSystemAndApiResponse(systemId, json);
|
await this.updateStopDataForSystemAndApiResponse(systemId, json);
|
||||||
await this.updateOrderedStopDataForExistingStops(json);
|
await this.updateOrderedStopDataForExistingStops(json);
|
||||||
await this.updatePolylineDataForExistingRoutesAndApiResponse(json);
|
await this.updatePolylineDataForExistingRoutesAndApiResponse(json);
|
||||||
|
} catch(e: any) {
|
||||||
|
console.error(`fetchAndUpdateStopAndPolylineDataForRoutesWithSystemId failed for system ID ${systemId}:`, e);
|
||||||
|
throw new ApiResponseError(e.message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public async fetchAndUpdateShuttleDataForExistingSystems() {
|
public async fetchAndUpdateShuttleDataForExistingSystems() {
|
||||||
|
|||||||
Reference in New Issue
Block a user