MCPcopy Index your code
hub / github.com/QLHazyCoder/FlowPilot / reportError

Function reportError

content/utils.js:316–340  ·  view source on GitHub ↗

* Report step error. * @param {number} step * @param {string} errorMessage

(step, errorMessage)

Source from the content-addressed store, hash-verified

314 * @param {string} errorMessage
315 */
316function reportError(step, errorMessage) {
317 console.error(LOG_PREFIX, `步骤 ${step} 失败: ${errorMessage}`);
318 log(`步骤 ${step} 失败:${errorMessage}`, 'error');
319 const message = {
320 type: 'STEP_ERROR',
321 source: SCRIPT_SOURCE,
322 step,
323 payload: {},
324 error: errorMessage,
325 };
326 Promise.resolve(chrome.runtime.sendMessage(message))
327 .then((response) => {
328 console.log(LOG_PREFIX, `STEP_ERROR sent successfully for step ${step}`, {
329 response,
330 url: location.href,
331 errorMessage,
332 });
333 })
334 .catch((err) => {
335 console.error(LOG_PREFIX, `STEP_ERROR send failed for step ${step}`, err?.message || err, {
336 url: location.href,
337 errorMessage,
338 });
339 });
340}
341
342/**
343 * Simulate a click with proper event dispatching.

Callers 3

signup-page.jsFile · 0.85
vps-panel.jsFile · 0.85
sub2api-panel.jsFile · 0.85

Calls 1

logFunction · 0.85

Tested by

no test coverage detected