aboutsummaryrefslogtreecommitdiff
path: root/lib/compilers
diff options
context:
space:
mode:
authorkasperk81 <83082615+kasperk81@users.noreply.github.com>2023-08-23 03:30:16 +0300
committerGitHub <noreply@github.com>2023-08-22 19:30:16 -0500
commitb3fd6f5c5ce010793dcc3d513e6b3c1036257b5b (patch)
tree21ce313d0dacc0c5bd349aa068408a67f9103c3d /lib/compilers
parent5c51cecd9cad7e7e95d01bb78c485323b48e80e9 (diff)
downloadcompiler-explorer-b3fd6f5c5ce010793dcc3d513e6b3c1036257b5b.tar.gz
compiler-explorer-b3fd6f5c5ce010793dcc3d513e6b3c1036257b5b.zip
dotnet: show the actual error when compilation fails (#5410)gh-8575
instead of ENOENT from the next line (fs.readFile), return the failed compilation result.
Diffstat (limited to 'lib/compilers')
-rw-r--r--lib/compilers/dotnet.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/compilers/dotnet.ts b/lib/compilers/dotnet.ts
index e631b5737..5b767ceda 100644
--- a/lib/compilers/dotnet.ts
+++ b/lib/compilers/dotnet.ts
@@ -259,10 +259,12 @@ class DotNetCompiler extends BaseCompiler {
execOptions.maxOutput = 1024 * 1024 * 1024;
const compilerResult = await super.runCompiler(compiler, publishOptions, inputFilename, execOptions);
- if (compilerResult.code === 0) {
- await fs.createFile(this.getOutputFilename(programDir, this.outputFilebase));
+ if (compilerResult.code !== 0) {
+ return compilerResult;
}
+ await fs.createFile(this.getOutputFilename(programDir, this.outputFilebase));
+
const version = '// ilc ' + toolVersion;
const output = await fs.readFile(jitOutFile);