UNPKG

@sap/cli-core

Version:

Command-Line Interface (CLI) Core Module

19 lines (18 loc) 576 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.create = void 0; const logger_1 = require("../../logger"); const create = (handler) => async (command) => { const commandHandler = await handler(command); return async (...args) => { try { await commandHandler(...args); } catch (err) { const { error } = (0, logger_1.get)("commands.handler.resilient"); error("handler failed, ignoring it silently", err); } }; }; exports.create = create; /* jscpd:ignore-end */