UNPKG

afrimomo-sdk

Version:

A unified SDK for African payment providers

22 lines 640 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isServiceError = isServiceError; exports.wrapServiceCall = wrapServiceCall; function isServiceError(result) { return (typeof result === "object" && result !== null && "errorMessage" in result && "statusCode" in result); } async function wrapServiceCall(operation, errorHandler, context) { try { return await operation(); } catch (error) { if (isServiceError(error)) { return error; } return errorHandler(error, context); } } //# sourceMappingURL=serviceWrapper.js.map