mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-24 15:38:10 +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",
|
method: "POST",
|
||||||
body: formData,
|
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();
|
return response.json();
|
||||||
},
|
},
|
||||||
onSuccess: (data) => {
|
onSuccess: (data) => {
|
||||||
@@ -128,8 +131,14 @@ export default function MobileNewReel() {
|
|||||||
setSelectedVideo(data);
|
setSelectedVideo(data);
|
||||||
toast({ title: "Succès", description: "Vidéo téléchargée" });
|
toast({ title: "Succès", description: "Vidéo téléchargée" });
|
||||||
},
|
},
|
||||||
onError: () => {
|
onError: (error) => {
|
||||||
toast({ title: "Erreur", description: "Échec upload", variant: "destructive" });
|
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