Files
bruno/packages/bruno-cli/src/constants.js
Johannes Zorn 811a6e6034 fix(#2122): add specific error status codes (#2126)
* fix: add specific error status codes #2122

This change adds specific exit status codes to identify different problems programatically

* feat(#2122): Document the cli exit status codes

* Update packages/bruno-cli/src/constants.js

Co-authored-by: Andreas Siegel <mail@andreassiegel.de>

* Update packages/bruno-cli/src/constants.js

Co-authored-by: Andreas Siegel <mail@andreassiegel.de>

* Update packages/bruno-cli/src/commands/run.js

Co-authored-by: Andreas Siegel <mail@andreassiegel.de>

* Update packages/bruno-cli/src/commands/run.js

Co-authored-by: Andreas Siegel <mail@andreassiegel.de>

* Update packages/bruno-cli/src/commands/run.js

Co-authored-by: Andreas Siegel <mail@andreassiegel.de>

* Update packages/bruno-cli/src/commands/run.js

Co-authored-by: Andreas Siegel <mail@andreassiegel.de>

* Update packages/bruno-cli/src/commands/run.js

Co-authored-by: Andreas Siegel <mail@andreassiegel.de>

* Update packages/bruno-cli/src/commands/run.js

Co-authored-by: Andreas Siegel <mail@andreassiegel.de>

* Update packages/bruno-cli/src/commands/run.js

Co-authored-by: Andreas Siegel <mail@andreassiegel.de>

* Update packages/bruno-cli/src/commands/run.js

Co-authored-by: Andreas Siegel <mail@andreassiegel.de>

* Update packages/bruno-cli/src/commands/run.js

Co-authored-by: Andreas Siegel <mail@andreassiegel.de>

* Update packages/bruno-cli/src/commands/run.js

Co-authored-by: Andreas Siegel <mail@andreassiegel.de>

---------

Co-authored-by: Andreas Siegel <mail@andreassiegel.de>
2024-06-05 20:29:59 +05:30

35 lines
998 B
JavaScript

const { version } = require('../package.json');
const CLI_EPILOGUE = `Documentation: https://docs.usebruno.com (v${version})`;
const CLI_VERSION = version;
// Exit codes
const EXIT_STATUS = {
// One or more assertions, tests, or requests failed
ERROR_FAILED_COLLECTION: 1,
// The specified output dir does not exist
ERROR_MISSING_OUTPUT_DIR: 2,
// request chain caused an endless loop
ERROR_INFINTE_LOOP: 3,
// bru was called outside of a collection root
ERROR_NOT_IN_COLLECTION: 4,
// The specified file was not found
ERROR_FILE_NOT_FOUND: 5,
// The specified environment was not found
ERROR_ENV_NOT_FOUND: 6,
// Environment override not presented as string or object
ERROR_MALFORMED_ENV_OVERRIDE: 7,
// Environment overrides format incorrect
ERROR_INCORRECT_ENV_OVERRIDE: 8,
// Invalid output format requested
ERROR_INCORRECT_OUTPUT_FORMAT: 9,
// Everything else
ERROR_GENERIC: 255,
};
module.exports = {
CLI_EPILOGUE,
CLI_VERSION,
EXIT_STATUS
};