MCPcopy Create free account
hub / github.com/Azure/powershell / _setResult

Method _setResult

lib/index.js:2325–2346  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2323 this.emit('debug', message);
2324 }
2325 _setResult() {
2326 // determine whether there is an error
2327 let error;
2328 if (this.processExited) {
2329 if (this.processError) {
2330 error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`);
2331 }
2332 else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {
2333 error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
2334 }
2335 else if (this.processStderr && this.options.failOnStdErr) {
2336 error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);
2337 }
2338 }
2339 // clear the timeout
2340 if (this.timeout) {
2341 clearTimeout(this.timeout);
2342 this.timeout = null;
2343 }
2344 this.done = true;
2345 this.emit('done', error, this.processExitCode);
2346 }
2347 static HandleTimeout(state) {
2348 if (state.done) {
2349 return;

Callers 2

CheckCompleteMethod · 0.95
HandleTimeoutMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected