UNPKG

@sap/cli-core

Version:

Command-Line Interface (CLI) Core Module

15 lines (14 loc) 445 B
import { get } from "../../logger/index.js"; export const create = (handler) => async (command) => { const commandHandler = await handler(command); return async (...args) => { try { await commandHandler(...args); } catch (err) { const { error } = get("commands.handler.resilient"); error("handler failed, ignoring it silently", err); } }; }; /* jscpd:ignore-end */