rename to throwContextualError
This commit is contained in:
@@ -33,7 +33,7 @@ class System {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const throwErrorShowing = (message) => {
|
const throwContextualError = (message) => {
|
||||||
let commandAsString = command;
|
let commandAsString = command;
|
||||||
if (Array.isArray(arguments_)) {
|
if (Array.isArray(arguments_)) {
|
||||||
commandAsString += ` ${arguments_.join(' ')}`;
|
commandAsString += ` ${arguments_.join(' ')}`;
|
||||||
@@ -48,11 +48,11 @@ class System {
|
|||||||
const exitCode = await exec(command, arguments_, { silent: true, listeners, ...options });
|
const exitCode = await exec(command, arguments_, { silent: true, listeners, ...options });
|
||||||
showOutput();
|
showOutput();
|
||||||
if (exitCode !== 0) {
|
if (exitCode !== 0) {
|
||||||
throwErrorShowing(`Command returned non-zero exit code.\nError: ${error}`);
|
throwContextualError(`Command returned non-zero exit code.\nError: ${error}`);
|
||||||
}
|
}
|
||||||
} catch (inCommandError) {
|
} catch (inCommandError) {
|
||||||
showOutput();
|
showOutput();
|
||||||
throwErrorShowing(`In-command error caught: ${inCommandError}`);
|
throwContextualError(`In-command error caught: ${inCommandError}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
Reference in New Issue
Block a user