some fixes

This commit is contained in:
amirrezaghabeli
2025-10-06 10:32:58 +03:30
parent 0653cdb6d7
commit 7e1240dffb
20 changed files with 40 additions and 2012 deletions
+19
View File
@@ -0,0 +1,19 @@
import 'package:tm_app/core/network/app_exceptions.dart';
/// Utility class for handling error messages
class ErrorUtils {
/// Extracts a clean error message from an Exception
static String getErrorMessage(Exception error) {
if (error is AppException) {
return error.message;
}
// For plain Exception, remove "Exception: " prefix
final errorString = error.toString();
if (errorString.startsWith('Exception: ')) {
return errorString.substring(11);
}
return errorString;
}
}