Implement tender workflows and dashboard integration
continuous-integration/drone/push Build encountered an error

This commit is contained in:
AmirReza Jamali
2026-07-14 11:12:09 +03:30
parent ce170f9bc8
commit 72881df210
29 changed files with 1820 additions and 159 deletions
+14 -11
View File
@@ -179,7 +179,16 @@ class NetworkManager {
/// Handle HTTP error responses
Result<T> _handleHttpError<T>(Response response) {
final statusCode = response.statusCode;
final message = _extractErrorMessage(response.data);
var message = _extractErrorMessage(response.data);
if (statusCode == 422 && response.data is Map<String, dynamic>) {
final envelope = response.data as Map<String, dynamic>;
final error = envelope['error'];
if (error is Map<String, dynamic> &&
error['details'] is String &&
(error['details'] as String).isNotEmpty) {
message = error['details'] as String;
}
}
switch (statusCode) {
case 400:
@@ -238,16 +247,10 @@ class NetworkManager {
);
case DioExceptionType.badResponse:
if (e.response?.statusCode == 401) {
// Handle token refresh logic here if needed
// For now, return authentication error
return Result.error(
AuthenticationException(
'Authentication failed',
e.response?.statusCode,
e,
),
);
if (e.response != null) {
// Preserve the backend envelope (including validation details) for
// non-2xx responses such as 409 and 422.
return _handleHttpError(e.response!);
}
return Result.error(
FetchDataException(