Fix error handling in file explorer by updating DioError to DioException for improved error message extraction
This commit is contained in:
@@ -342,7 +342,7 @@ class _FileExplorerState extends State<FileExplorer> {
|
||||
snackController.close();
|
||||
String errorMsg = e.toString();
|
||||
// If DioError, try to extract backend error message
|
||||
if (e is DioError) {
|
||||
if (e is DioException) {
|
||||
final data = e.response?.data;
|
||||
if (data is Map && data.containsKey('message')) {
|
||||
errorMsg = data['message'].toString();
|
||||
|
||||
Reference in New Issue
Block a user