mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-24 12:11:12 -05:00
Improve error handling and authentication for uploads and notifications
Refactor PhotoUpload component to fetch session token before polling, enhance error handling in NotificationService and versioningHelpers with `instanceof Error` checks, and add comprehensive validation for request body fields in the create-novu-subscriber Supabase function. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 8d708ff6-09f1-4b67-8edc-de3fcb2349b3 Replit-Commit-Checkpoint-Type: intermediate_checkpoint
This commit is contained in:
@@ -67,7 +67,7 @@ class NotificationService {
|
||||
return { success: true };
|
||||
} catch (error: any) {
|
||||
console.error('Error creating Novu subscriber:', error);
|
||||
return { success: false, error: error.message };
|
||||
return { success: false, error: error instanceof Error ? error.message : 'An unexpected error occurred' };
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ class NotificationService {
|
||||
return { success: true };
|
||||
} catch (error: any) {
|
||||
console.error('Error updating Novu subscriber:', error);
|
||||
return { success: false, error: error.message };
|
||||
return { success: false, error: error instanceof Error ? error.message : 'An unexpected error occurred' };
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ export async function createEntityVersion(params: {
|
||||
console.error('Error creating entity version:', error);
|
||||
toast({
|
||||
title: 'Version Creation Failed',
|
||||
description: error.message,
|
||||
description: error instanceof Error ? error.message : 'An unexpected error occurred',
|
||||
variant: 'destructive',
|
||||
});
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user