MCPcopy Create free account
hub / github.com/bigcommerce/stencil-cli / printCliResultError

Function printCliResultError

lib/cliCommon.js:40–56  ·  view source on GitHub ↗

* @param {Error} error * @param {Array<{message: string}>} [error.messages] * @returns {void}

(error)

Source from the content-addressed store, hash-verified

38 * @returns {void}
39 */
40function printCliResultError(error) {
41 console.error(`\n\n${'not ok'.red} -- ${error || 'Unknown error'}\n`);
42 if (error && Array.isArray(error.messages)) {
43 for (const item of error.messages) {
44 if (item && item.message) {
45 console.log(`${item.message.red}\n`);
46 }
47 }
48 }
49 if (error && (error.config || error.response)) {
50 // In case if request didn't receive any response, response object is not available
51 const networkReq = error.config || error.response;
52 printNetworkError(networkReq);
53 }
54 console.log(messages.visitTroubleshootingPage);
55 console.log(messages.submitGithubIssue);
56}
57/**
58 * @param {Error} error
59 * @returns {void}

Callers 2

cliCommon.spec.jsFile · 0.90

Calls 2

printNetworkErrorFunction · 0.85
logMethod · 0.80

Tested by

no test coverage detected