Skip to content

Commit

Permalink
fix(NA): include simple error message to preserve subprocess failure …
Browse files Browse the repository at this point in the history
…state
  • Loading branch information
mistic committed Apr 12, 2021
1 parent 8623196 commit 7950d47
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion packages/kbn-pm/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48380,6 +48380,7 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var _kbn_dev_utils_stdio__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_kbn_dev_utils_stdio__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _child_process__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(319);
/* harmony import */ var _log__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(246);
/* harmony import */ var _errors__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(249);
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
Expand All @@ -48400,6 +48401,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope




async function runBazelCommandWithRunner(bazelCommandRunner, bazelArgs, offline = false, runOpts = {}) {
// Force logs to pipe in order to control the output of them
const bazelOpts = _objectSpread(_objectSpread({}, runOpts), {}, {
Expand All @@ -48418,7 +48420,8 @@ async function runBazelCommandWithRunner(bazelCommandRunner, bazelArgs, offline

try {
await bazelProc;
} catch {// no-op
} catch {
throw new _errors__WEBPACK_IMPORTED_MODULE_6__["CliError"](`The bazel command that was running failed to complete.`);
}

await bazelLogs$.toPromise();
Expand Down
3 changes: 2 additions & 1 deletion packages/kbn-pm/src/utils/bazel/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { tap } from 'rxjs/operators';
import { observeLines } from '@kbn/dev-utils/stdio';
import { spawn } from '../child_process';
import { log } from '../log';
import { CliError } from '../errors';

type BazelCommandRunner = 'bazel' | 'ibazel';

Expand Down Expand Up @@ -51,7 +52,7 @@ async function runBazelCommandWithRunner(
try {
await bazelProc;
} catch {
// no-op
throw new CliError(`The bazel command that was running failed to complete.`);
}
await bazelLogs$.toPromise();
await bazelLogSubscription.unsubscribe();
Expand Down

0 comments on commit 7950d47

Please sign in to comment.