Skip to content

Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation

592 B
Raw Blame
export function workerFailure(code, result, summary, signal) {
  if (code === 0) return null;
  if (result?.error) return result.error;
  if (code === 99) {
    const failed = Object.entries(summary?.metrics || {}).flatMap(([name, metric]) =>
      Object.entries(metric.thresholds || {}).filter(([, check]) => check.ok === false)
        .map(([expression]) => `${name} (${expression})`));
    return `Load completed but k6 thresholds failed${failed.length ? ': ' + failed.join(', ') : ''}. Open Results → Responses for recorded errors.`;
  }
  return `Worker exited ${code ?? signal}`;
}