mirror of
https://github.com/usebruno/bruno.git
synced 2024-11-07 08:34:15 +01:00
Update error messages displayed
This commit is contained in:
parent
33427daa0e
commit
970b14c409
@ -307,14 +307,14 @@ const handler = async function (argv) {
|
||||
const collectionPath = collectionDir ? path.resolve(collectionDir) : process.cwd();
|
||||
|
||||
if (collectionDir && !fs.existsSync(collectionPath)) {
|
||||
console.error(chalk.red(`The specified collection directory does not exist: ${collectionPath}`));
|
||||
console.error(chalk.red(`Could not find the specified collection directory: ${collectionPath}`));
|
||||
process.exit(constants.EXIT_STATUS.ERROR_COLLECTION_DIR_NOT_FOUND);
|
||||
}
|
||||
|
||||
const brunoJsonPath = path.join(collectionPath, 'bruno.json');
|
||||
const brunoJsonExists = await exists(brunoJsonPath);
|
||||
if (!brunoJsonExists) {
|
||||
console.error(chalk.red(`You can run only at the root of a collection`));
|
||||
console.error(chalk.red(`Please navigate into the root directory or specify using --dir`));
|
||||
process.exit(constants.EXIT_STATUS.ERROR_NOT_IN_COLLECTION);
|
||||
}
|
||||
|
||||
|
@ -23,6 +23,8 @@ const EXIT_STATUS = {
|
||||
ERROR_INCORRECT_ENV_OVERRIDE: 8,
|
||||
// Invalid output format requested
|
||||
ERROR_INCORRECT_OUTPUT_FORMAT: 9,
|
||||
// Invalid directory specified, specified directory does not contain bruno.json file
|
||||
ERROR_COLLECTION_DIR_NOT_FOUND: 10,
|
||||
// Everything else
|
||||
ERROR_GENERIC: 255,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user