diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b07f944..0fcd63ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## 3.1.0 IN PROGRESS +* Log additional error details. Refs STCLI-240. + ## [3.0.0](https://github.com/folio-org/stripes-cli/tree/v3.0.0) (2023-10-11) [Full Changelog](https://github.com/folio-org/stripes-cli/compare/v2.7.0...v3.0.0) diff --git a/lib/cli/context.js b/lib/cli/context.js index ce1e02a6..24b949d2 100644 --- a/lib/cli/context.js +++ b/lib/cli/context.js @@ -41,6 +41,7 @@ function loadXml(filePath) { const data = fs.readFileSync(filePath, 'utf-8'); xml = (new XMLParser()).parse(data); } catch (err) { + console.error('Something went wrong reading or parsing the XML file.'); console.log(err); } return xml; diff --git a/lib/cli/global-dirs.js b/lib/cli/global-dirs.js index 3e2ed548..0208eaae 100644 --- a/lib/cli/global-dirs.js +++ b/lib/cli/global-dirs.js @@ -10,7 +10,7 @@ function isYarnVersion(version) { logger.log('Yarn version', yarnVersion); return semver.satisfies(yarnVersion, version); } catch (err) { - logger.log('Unable to determine Yarn version.', err); + logger.error('Unable to determine Yarn version.', err); return false; } } diff --git a/lib/cli/stripes-config-middleware.js b/lib/cli/stripes-config-middleware.js index c53ae165..ee5e4c5b 100644 --- a/lib/cli/stripes-config-middleware.js +++ b/lib/cli/stripes-config-middleware.js @@ -10,6 +10,7 @@ function loadStripesConfig(stripesConfigFile) { try { config = require(path.resolve(stripesConfigFile)); // eslint-disable-line } catch (err) { + console.error(err); throw new StripesCliError(`Unable to load ${stripesConfigFile}`); } return config; diff --git a/lib/commands/mod/install.js b/lib/commands/mod/install.js index 9b10ddfb..3625e742 100644 --- a/lib/commands/mod/install.js +++ b/lib/commands/mod/install.js @@ -31,6 +31,7 @@ function installModulesCommand(argv) { try { console.log(JSON.stringify(response, null, 2)); } catch (err) { + console.error(err); console.log(response); } }) diff --git a/lib/commands/translate/compile.js b/lib/commands/translate/compile.js index fbf33b6c..bc926c35 100644 --- a/lib/commands/translate/compile.js +++ b/lib/commands/translate/compile.js @@ -27,7 +27,7 @@ const createOutDir = (outDir) => { fs.mkdirSync(outDir); } catch (err) { console.error(`Could not create the output directory ${outDir}`); - console.error(err); + console.info(err); process.exit(1); } } diff --git a/lib/create-app.js b/lib/create-app.js index ea57b7ab..c6305969 100644 --- a/lib/create-app.js +++ b/lib/create-app.js @@ -109,7 +109,8 @@ async function createApp(appName, appDescription) { results.forEach(result => updateTemplate(result, args)); console.log('App created successfully'); } catch (err) { - console.log(err.stack); + console.error('Something went wrong while creating the app.'); + console.info(err); } return args; diff --git a/lib/stripes-cli.js b/lib/stripes-cli.js index 7f2e6b48..8623ebe3 100755 --- a/lib/stripes-cli.js +++ b/lib/stripes-cli.js @@ -49,7 +49,7 @@ try { .parse(); } catch (err) { if (err instanceof AliasError) { - console.log(`Alias Error: ${err.message}`); + console.error(`Alias Error: ${err.message}`); } else { throw err; } diff --git a/lib/test/setup-bigtest.js b/lib/test/setup-bigtest.js index ca63eabf..88078cba 100644 --- a/lib/test/setup-bigtest.js +++ b/lib/test/setup-bigtest.js @@ -30,7 +30,8 @@ async function setupBigTest() { fs.removeSync(localTemp); console.log('BigTest setup successfully'); }).catch((err) => { - console.log(err.stack); + console.error('Error setting up BigTest'); + console.info(err); }); }