Zum Hauptinhalt springen
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
IT Security NachrichtenWarum Cybersicherheit beim Menschen beginnt(30.09.2026 um 05:03 Uhr)
•••
IT Security DownloadsGitHub Release: cli/cli v2.102.0 (30.09.2026)(30.09.2026 um 04:41 Uhr)
•
AI & KI NachrichtenGitHub Release: cline/cline vcli-v3.0.66 (30.09.2026)(30.09.2026 um 04:41 Uhr)
•
IT Security DownloadsGitHub Release: cline/cline vdesktop-v0.0.38 (30.09.2026)(30.09.2026 um 04:57 Uhr)
•
IT Security DownloadsGitHub Release: matomo-org/matomo v5.14.1-rc1 (30.09.2026)(30.09.2026 um 04:47 Uhr)
•••
Apple iOS & macOSApple Pay Officially Goes Live In India For Axis Bank Customers(30.09.2026 um 04:30 Uhr)
•
IT Security NachrichtenWarum Cybersicherheit beim Menschen beginnt(30.09.2026 um 05:03 Uhr)
•••
IT Security DownloadsGitHub Release: cli/cli v2.102.0 (30.09.2026)(30.09.2026 um 04:41 Uhr)
•
AI & KI NachrichtenGitHub Release: cline/cline vcli-v3.0.66 (30.09.2026)(30.09.2026 um 04:41 Uhr)
•
IT Security DownloadsGitHub Release: cline/cline vdesktop-v0.0.38 (30.09.2026)(30.09.2026 um 04:57 Uhr)
•
IT Security DownloadsGitHub Release: matomo-org/matomo v5.14.1-rc1 (30.09.2026)(30.09.2026 um 04:47 Uhr)
•••
Apple iOS & macOSApple Pay Officially Goes Live In India For Axis Bank Customers(30.09.2026 um 04:30 Uhr)
•
Intelligence View
⚡ tsecurity.de Intelligence

Supabase Edge Function Error Handling — Retries, Logging, and Idempotency

Supabase Edge Function Error Handling — Retries, Logging, and Idempotency Design patterns to prevent errors from being swallowed silently in production EFs. Basics: Return Structured Errors // s…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!




Supabase Edge Function Error Handling — Retries, Logging, and Idempotency



Design patterns to prevent errors from being swallowed silently in production EFs.






Basics: Return Structured Errors






// supabase/functions/_shared/error.ts
export class AppError extends Error {
constructor(
message: string,
public readonly code: string,
public readonly status: number = 500,
) {
super(message);
}
}

export function errorResponse(error: unknown): Response {
if (error instanceof AppError) {
return new Response(
JSON.stringify({ error: error.message, code: error.code }),
{ status: error.status, headers: { 'Content-Type': 'application/json' } },
);
}
console.error('Unexpected error:', error);
return new Response(
JSON.stringify({ error: 'Internal server error', code: 'INTERNAL' }),
{ status: 500, headers: { 'Content-Type': 'application/json' } },
);
}









Fetch with Retry






async function fetchWithRetry(
url: string,
options: RequestInit,
maxRetries = 3,
): Promise<Response> {
let lastError: Error | undefined;

for (let attempt = 1; attempt <= maxRetries; attempt++) {
try {
const res = await fetch(url, options);
if (res.status === 429) {
// Rate limit: exponential backoff
const wait = Math.pow(2, attempt) * 1000;
await new Promise(r => setTimeout(r, wait));
continue;
}
if (!res.ok && res.status >= 500) {
throw new Error(`HTTP ${res.status}`);
}
return res;
} catch (e) {
lastError = e as Error;
if (attempt < maxRetries) {
await new Promise(r => setTimeout(r, attempt * 500));
}
}
}
throw lastError ?? new Error('Max retries exceeded');
}









Structured Logging






// Common log format across all EFs
function log(level: 'info' | 'warn' | 'error', message: string, meta?: object) {
console.log(JSON.stringify({
level,
message,
timestamp: new Date().toISOString(),
function: Deno.env.get('FUNCTION_NAME') ?? 'unknown',
...meta,
}));
}

// Usage
log('info', 'Processing webhook', { event_type: event.type });
log('error', 'Stripe API failed', { attempt: 3, status: 500 });









Idempotent Webhook Processing






// Prevent double-processing the same event
const { data: processed } = await supabase
.from('processed_webhooks')
.select('id')
.eq('event_id', event.id)
.maybeSingle();

if (processed) {
return new Response('ok'); // silently ignore duplicates
}

// Record after processing
await supabase.from('processed_webhooks').insert({
event_id: event.id,
processed_at: new Date().toISOString(),
});









Summary






Error responses  → AppError + errorResponse (structured JSON)
Retries → exponential backoff (for 429 and 5xx)
Logging → structured JSON logs (searchable in Supabase Dashboard)
Idempotency → processed_webhooks table prevents double-processing






Design EFs to be "safe to fail" by default.

2. Cyber Threat Intelligence & Forensik

CTI Threat Relationship Graph2 Knoten / 1 Relationen
CVE / Incident Software MITRE ATT&CK CWE Weakness IoC
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Supabase Edge Function Error Handling — Retries, Logging, and Idempotency

Thematisch verwandte Begriffe: Supabase, Edge, Function, Error · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

💬 Kommentare werden geladen…
Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-102771 | A security vulnerability has been detected in Naichen ThinkCMF up to 8.…
Advisory →
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag