Skip to content

Debugging ve Error Handling

  • Error types ve handling
  • Retry stratejileri
  • Logging techniques
// D1_EXEC_ERROR
// D1_TYPE_ERROR
// D1_COLUMN_NOTFOUND
try {
await db.exec("INVALID SQL");
} catch (error) {
console.error("D1 Error:", error.message);
}
async function retryQuery<T>(
query: () => Promise<T>,
maxRetries = 3
): Promise<T> {
for (let i = 0; i < maxRetries; i++) {
try {
return await query();
} catch (error) {
if (i === maxRetries - 1) throw error;
await new Promise(r => setTimeout(r, Math.pow(2, i) * 100));
}
}
}

✅ Error handling ✅ Retry strategies

Metrics ve Analytics - Monitoring.


Ders Süresi: 60 dakika Zorluk Seviyesi: İleri