From 51b0b44146b0e047c5f3f0bfa533a7f88c542981 Mon Sep 17 00:00:00 2001 From: Mateusz Konieczny Date: Fri, 18 Nov 2022 16:46:27 +0100 Subject: [PATCH] provide more clear errors --- app/src/tiles/tileserver.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/tiles/tileserver.ts b/app/src/tiles/tileserver.ts index 07c99a58..38a9c511 100644 --- a/app/src/tiles/tileserver.ts +++ b/app/src/tiles/tileserver.ts @@ -38,16 +38,16 @@ router.get('/:tileset/:z/:x/:y(\\d+):scale(@\\dx)?.png', handleTileRequest); function parseTileParams(params: any): TileParams { const { tileset, z, x, y, scale } = params; - if (!allTilesets.includes(tileset)) throw new Error('Invalid value for tileset'); + if (!allTilesets.includes(tileset)) throw new Error('Invalid value for tileset: ' + tileset); const intZ = strictParseInt(z); - if (isNaN(intZ)) throw new Error('Invalid value for z'); + if (isNaN(intZ)) throw new Error('Invalid value for z: ' + intZ); const intX = strictParseInt(x); - if (isNaN(intX)) throw new Error('Invalid value for x'); + if (isNaN(intX)) throw new Error('Invalid value for x: ' + intX); const intY = strictParseInt(y); - if (isNaN(intY)) throw new Error('Invalid value for y'); + if (isNaN(intY)) throw new Error('Invalid value for y: ' + intY); let intScale: number; if (scale === '@2x') {