Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STCLI-240 thoroughly log errors #340

Merged
merged 1 commit into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
1 change: 1 addition & 0 deletions lib/cli/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/cli/global-dirs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
1 change: 1 addition & 0 deletions lib/cli/stripes-config-middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions lib/commands/mod/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ function installModulesCommand(argv) {
try {
console.log(JSON.stringify(response, null, 2));
} catch (err) {
console.error(err);
console.log(response);
}
})
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/translate/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
3 changes: 2 additions & 1 deletion lib/create-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/stripes-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
3 changes: 2 additions & 1 deletion lib/test/setup-bigtest.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}

Expand Down
Loading