MCPcopy Create free account
hub / github.com/xerrors/Yuxi / handleAsync

Method handleAsync

web/src/utils/errorHandler.js:120–127  ·  view source on GitHub ↗

* 处理异步操作错误 * @param {Function} asyncFn - 异步函数 * @param {string} context - 错误上下文 * @param {Object} options - 配置选项

(asyncFn, context, options = {})

Source from the content-addressed store, hash-verified

118 * @param {Object} options - 配置选项
119 */
120 static async handleAsync(asyncFn, context, options = {}) {
121 try {
122 return await asyncFn()
123 } catch (error) {
124 this.handleError(error, context, options)
125 throw error
126 }
127 }
128
129 /**
130 * 创建错误处理装饰器

Callers

nothing calls this directly

Calls 1

handleErrorMethod · 0.95

Tested by

no test coverage detected