Skip to content

Commit

Permalink
Fail if compiler discovery fails (#4331)
Browse files Browse the repository at this point in the history
* Fail if compiler discovery fails
  • Loading branch information
mattgodbolt committed Nov 23, 2022
1 parent 85120d9 commit f371b10
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 0 additions & 3 deletions app.js
Expand Up @@ -529,9 +529,6 @@ async function main() {
}
logger.info(`Compiler scan count: ${_.size(compilers)}`);
logger.debug('Compilers:', compilers);
if (compilers.length === 0) {
logger.error('#### No compilers found: no compilation will be done!');
}
prevCompilers = compilers;
await clientOptionsHandler.setCompilers(compilers);
routeApi.apiHandler.setCompilers(compilers);
Expand Down
4 changes: 4 additions & 0 deletions lib/compiler-finder.js
Expand Up @@ -403,6 +403,10 @@ export class CompilerFinder {
compilerList.flat(Infinity),
this.optionsHandler.get(),
);
if (!compilers) {
logger.error('#### No compilers found: no compilation will be done!');
throw new Error('No compilers found due to error or no configuration');
}
const result = this.ensureDistinct(_.compact(compilers));
return {foundClash: result.foundClash, compilers: _.sortBy(result.compilers, 'name')};
}
Expand Down

0 comments on commit f371b10

Please sign in to comment.