(msg: string)
| 74 | } |
| 75 | |
| 76 | function extractErrorClass(msg: string): string { |
| 77 | const prismaCode = msg.match(/P\d{4}/)?.[0] |
| 78 | if (prismaCode) return prismaCode |
| 79 | if (msg.includes('ENOENT')) return 'ENOENT' |
| 80 | if (msg.includes('EACCES')) return 'EACCES' |
| 81 | if (msg.includes('ETIMEDOUT') || msg.includes('timeout')) return 'TIMEOUT' |
| 82 | if (msg.includes('datasource')) return 'DATASOURCE_CONFIG' |
| 83 | if (msg.includes('authenticate') || msg.includes('credentials')) return 'AUTH' |
| 84 | return 'UNKNOWN' |
| 85 | } |
| 86 | |
| 87 | export async function emitFlowCompleted( |
| 88 | ctx: TelemetryContext, |
no test coverage detected