diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2021-10-13 16:12:56 +0200 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2021-10-20 13:04:26 +0200 |
| commit | caa5af54e83d27a02f1ec5c017641660a3cd299d (patch) | |
| tree | 3455a8b225133de39a41c7ffc59427c6b23b8ab2 /gui/scripts | |
| parent | 592a7939f7a2c9a97b839fa426d21fa2e31e5938 (diff) | |
| download | mullvadvpn-caa5af54e83d27a02f1ec5c017641660a3cd299d.tar.xz mullvadvpn-caa5af54e83d27a02f1ec5c017641660a3cd299d.zip | |
Add error cast and format
Diffstat (limited to 'gui/scripts')
| -rw-r--r-- | gui/scripts/prepare-rtree.ts | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/gui/scripts/prepare-rtree.ts b/gui/scripts/prepare-rtree.ts index f18f772aa0..27fabb2f13 100644 --- a/gui/scripts/prepare-rtree.ts +++ b/gui/scripts/prepare-rtree.ts @@ -23,16 +23,17 @@ function main() { try { processGeometry(source, destination); - } catch (error) { + } catch (e) { + const error = e as Error; console.error(`Failed to process ${name}: ${error.message}`); } } } function processGeometry(source: string, destination: string) { - const collection = JSON.parse(fs.readFileSync(source, { encoding: 'utf8' })) as Topology< - GeometryTopologyObjects - >; + const collection = JSON.parse( + fs.readFileSync(source, { encoding: 'utf8' }), + ) as Topology<GeometryTopologyObjects>; const { geometry } = collection.objects; const treeData = geometry.geometries.map((object, i) => { |
