mirror of
				https://github.com/actions/setup-dotnet.git
				synced 2025-10-31 23:33:45 +00:00 
			
		
		
		
	Merge pull request #375 from akv-platform/fix-error-message
Make throwing errors in setup-dotnet more informative
This commit is contained in:
		
						commit
						c41fd15071
					
				
							
								
								
									
										4
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							| @ -398,9 +398,9 @@ class DotnetCoreInstaller { | |||||||
|                 ignoreReturnCode: true, |                 ignoreReturnCode: true, | ||||||
|                 env: process.env |                 env: process.env | ||||||
|             }; |             }; | ||||||
|             const { exitCode, stdout } = yield exec.getExecOutput(`"${scriptPath}"`, scriptArguments, getExecOutputOptions); |             const { exitCode, stderr } = yield exec.getExecOutput(`"${scriptPath}"`, scriptArguments, getExecOutputOptions); | ||||||
|             if (exitCode) { |             if (exitCode) { | ||||||
|                 throw new Error(`Failed to install dotnet ${exitCode}. ${stdout}`); |                 throw new Error(`Failed to install dotnet, exit code: ${exitCode}. ${stderr}`); | ||||||
|             } |             } | ||||||
|             return this.outputDotnetVersion(dotnetVersion.value); |             return this.outputDotnetVersion(dotnetVersion.value); | ||||||
|         }); |         }); | ||||||
|  | |||||||
| @ -236,13 +236,15 @@ export class DotnetCoreInstaller { | |||||||
|       ignoreReturnCode: true, |       ignoreReturnCode: true, | ||||||
|       env: process.env as {string: string} |       env: process.env as {string: string} | ||||||
|     }; |     }; | ||||||
|     const {exitCode, stdout} = await exec.getExecOutput( |     const {exitCode, stderr} = await exec.getExecOutput( | ||||||
|       `"${scriptPath}"`, |       `"${scriptPath}"`, | ||||||
|       scriptArguments, |       scriptArguments, | ||||||
|       getExecOutputOptions |       getExecOutputOptions | ||||||
|     ); |     ); | ||||||
|     if (exitCode) { |     if (exitCode) { | ||||||
|       throw new Error(`Failed to install dotnet ${exitCode}. ${stdout}`); |       throw new Error( | ||||||
|  |         `Failed to install dotnet, exit code: ${exitCode}. ${stderr}` | ||||||
|  |       ); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     return this.outputDotnetVersion(dotnetVersion.value); |     return this.outputDotnetVersion(dotnetVersion.value); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user