Improve error messages

This commit is contained in:
pietervdvn 2022-08-24 01:10:45 +02:00
parent 80963f242d
commit d4a2b5899b

View file

@ -5,7 +5,14 @@ import ScriptUtils from "./ScriptUtils";
const prompt = require('prompt-sync')(); const prompt = require('prompt-sync')();
function validateLicenseInfo(l : SmallLicense){ 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. * Sweeps the entire 'assets/' (except assets/generated) directory for image files and any 'license_info.json'-file.