"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.errorHandlerMiddleware=errorHandlerMiddleware;const faas_server_utils_1=require("@alipay/faas-server-utils"),errors_1=require("../../errors"),debug=(0,faas_server_utils_1.debuglog)("faas-server-sdk:httpRequest");async function errorHandlerMiddleware(e,s){try{await s()}catch(r){throw debug("%s %o got failed: %s",e.req.requestOptions.method,e.req.url,r.stack),errors_1.errors.NETWORK_ERR(r,e.requestId)}}