UNPKG

@adonisjs/ace

Version:

Commandline apps framework used by AdonisJs

29 lines (28 loc) 748 B
"use strict"; /* * @adonisjs/ace * * (c) Harminder Virk <virk@adonisjs.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.handleError = void 0; const cliui_1 = require("@poppinss/cliui"); /** * Handles the command errors and prints them to the console. */ // eslint-disable-next-line no-shadow function handleError(error, callback) { if (typeof callback === 'function') { callback(error); } else if (typeof error.handle === 'function') { error.handle(error); } else { cliui_1.logger.fatal(error); } } exports.handleError = handleError;