feat: update backend OCR parser, web app, mobile app camera/preview UI, tests, and documentation with sample images
This commit is contained in:
1 parent
aa3233e411
commit
bdb3a49742
71 files changed
+3360
-764
No files matched your search
@@ -50,7 +50,17 @@ class ApiClient {
|
||||
} else if (e.response != null) {
|
||||
// Standardized HTTP error formatting
|
||||
final statusCode = e.response?.statusCode;
|
||||
errorMessage = 'Server error ($statusCode): ${e.response?.data['message'] ?? 'Unknown'}';
|
||||
String serverMsg = 'Unknown';
|
||||
final responseData = e.response?.data;
|
||||
if (responseData is Map) {
|
||||
serverMsg = responseData['message'] ?? 'Unknown';
|
||||
} else if (responseData is String) {
|
||||
// Truncate raw string if it's a long HTML page
|
||||
serverMsg = responseData.length > 100
|
||||
? '${responseData.substring(0, 100)}...'
|
||||
: responseData;
|
||||
}
|
||||
errorMessage = 'Server error ($statusCode): $serverMsg';
|
||||
} else if (e.type == DioExceptionType.connectionError) {
|
||||
errorMessage = 'No internet connection.';
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user