Fix error handling in file explorer by updating DioError to DioException for improved error message extraction

This commit is contained in:
Leon Bösche
2026-01-14 17:32:03 +01:00
parent 2428dae1cc
commit 3d5593ca61

View File

@@ -342,7 +342,7 @@ class _FileExplorerState extends State<FileExplorer> {
snackController.close(); snackController.close();
String errorMsg = e.toString(); String errorMsg = e.toString();
// If DioError, try to extract backend error message // If DioError, try to extract backend error message
if (e is DioError) { if (e is DioException) {
final data = e.response?.data; final data = e.response?.data;
if (data is Map && data.containsKey('message')) { if (data is Map && data.containsKey('message')) {
errorMsg = data['message'].toString(); errorMsg = data['message'].toString();