From d4a2b5899b61f76939b88ef1493c3525abe8031c Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Wed, 24 Aug 2022 01:10:45 +0200 Subject: [PATCH] Improve error messages --- scripts/generateLicenseInfo.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/generateLicenseInfo.ts b/scripts/generateLicenseInfo.ts index fbfaecaee1..45d698621a 100644 --- a/scripts/generateLicenseInfo.ts +++ b/scripts/generateLicenseInfo.ts @@ -5,7 +5,14 @@ import ScriptUtils from "./ScriptUtils"; const prompt = require('prompt-sync')(); function validateLicenseInfo(l : SmallLicense){ - l.sources.map(s => new URL(s)) + l.sources.map(s => { + try{ + + return new URL(s); + }catch (e) { + throw "Could not parse URL "+s+" for a license for "+l.path+" due to "+ e + } + }) } /** * Sweeps the entire 'assets/' (except assets/generated) directory for image files and any 'license_info.json'-file.