File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
src/systems/datapackCompiler Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -996,9 +996,18 @@ export default async function compileDataPack(options: {
996996 }
997997 }
998998 // Remove mentions of the export namespace from the file
999- const content : IFunctionTag = JSON . parse (
1000- ( await fs . promises . readFile ( file ) ) . toString ( )
1001- )
999+ let content : IFunctionTag
1000+ // Remove mentions of the export namespace from the file
1001+ try {
1002+ content = JSON . parse ( ( await fs . promises . readFile ( file ) ) . toString ( ) )
1003+ } catch ( e ) {
1004+ if ( e instanceof SyntaxError ) {
1005+ throw new IntentionalExportError (
1006+ `Failed to parse function tag file: '${ file } '. Please ensure that the file is valid JSON.`
1007+ )
1008+ }
1009+ continue
1010+ }
10021011 content . values = content . values . filter (
10031012 v =>
10041013 typeof v === 'string' &&
You can’t perform that action at this time.
0 commit comments