Skip to content

Commit 51583c8

Browse files
committed
fix(OSM): error handling
1 parent 4ab36f3 commit 51583c8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

admin/app/services/docker_service.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ export class DockerService {
341341
});
342342

343343
this._broadcast(DockerService.OPENSTREETMAP_IMPORT_SERVICE_NAME, 'importing', `Processing initial import of OSM data. This may take some time...`);
344+
await disk.put(LOG_PATH, 'Beginning OpenStreetMap data import...\n');
344345

345346
const container = await this.docker.createContainer({
346347
Image: image,
@@ -364,6 +365,10 @@ export class DockerService {
364365
const data = await container.wait();
365366
logger.debug(`OpenStreetMap data import result: ${JSON.stringify(data)}`);
366367

368+
if (data.StatusCode !== 0) {
369+
throw new Error(`OpenStreetMap data import failed with status code ${data.StatusCode}. Check the log file at ${LOG_PATH} for details.`);
370+
}
371+
367372
await container.remove();
368373
}
369374

0 commit comments

Comments
 (0)