mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-11 17:26:45 +02:00
fix(mobile): improve upload error handling to debug ios failure
This commit is contained in:
1 parent
4954877c06
commit
d3da988cc0
1 file changed
+12
-3
@@ -119,7 +119,10 @@ export default function MobileNewReel() {
|
||||
method: "POST",
|
||||
body: formData,
|
||||
});
|
||||
if (!response.ok) throw new Error("Upload failed");
|
||||
if (!response.ok) {
|
||||
const errorText = await response.text();
|
||||
throw new Error(`Upload failed: ${response.status} ${response.statusText} - ${errorText.substring(0, 100)}`);
|
||||
}
|
||||
return response.json();
|
||||
},
|
||||
onSuccess: (data) => {
|
||||
@@ -128,8 +131,14 @@ export default function MobileNewReel() {
|
||||
setSelectedVideo(data);
|
||||
toast({ title: "Succès", description: "Vidéo téléchargée" });
|
||||
},
|
||||
onError: () => {
|
||||
toast({ title: "Erreur", description: "Échec upload", variant: "destructive" });
|
||||
onError: (error) => {
|
||||
console.error("Upload error details:", error);
|
||||
toast({
|
||||
title: "Erreur Upload",
|
||||
description: error.message || "Échec inattendu",
|
||||
variant: "destructive",
|
||||
duration: 5000
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user