Print error message to have better understanding of dataObjects errors.

This commit is contained in:
2023-08-14 15:50:12 +03:00
parent a1929fe33c
commit 81f5166043
+3 -1
View File
@@ -48,9 +48,11 @@ function getErrorHtml(message = '', errorMessage = '') {
}
export async function getBlockData(jsonFileName = 'default', {projectPath} = {jsonFileName: 'default'}) {
const data = await readJSONFile(path.join(projectPath, 'data', `${jsonFileName}.json`));
const filePath = path.join(projectPath, 'data', `${jsonFileName}.json`);
const data = await readJSONFile(filePath);
if (data.error) {
console.log(filePath, data.errorMessage.replace(/<[^>]*>?/gm, ''));
return {};
}