Try to debug JSON parsing failure

master
Aaron Suen 2021-09-10 08:08:00 -04:00
parent 425e716d17
commit 4f6575a987
2 changed files with 9 additions and 5 deletions

View File

@ -1,4 +1,3 @@
-- luacheck: push
-- luacheck: globals config readtext readbinary
@ -11,7 +10,7 @@ return {
type = "",
title = "",
short_description = "",
tags= {},
tags = {},
content_warnings = {},
license = "MIT",
media_license = "MIT",
@ -24,4 +23,4 @@ return {
screenshots = {readbinary("screenshot.png")}
}
-- luacheck: pop
-- luacheck: pop

View File

@ -41,6 +41,11 @@ module.exports = async cwd => {
hook.stdin.end();
await hook.promise;
const spec = JSON.parse(buff);
config.set('gitlua', spec);
try {
const spec = JSON.parse(buff);
config.set('gitlua', spec);
} catch (err) {
console.log('Raw JSON: ' + buff);
throw err;
}
};