Skip to content

Commit 35fc611

Browse files
committed
refactor(content_management): replace errorMessage with exception
- Changed `errorMessage` to `exception` - Improved error handling clarity - Uses HtHttpException for error type
1 parent 769fcee commit 35fc611

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/content_management/bloc/content_management_state.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class ContentManagementState extends Equatable {
3232
this.sources = const [],
3333
this.sourcesCursor,
3434
this.sourcesHasMore = false,
35-
this.errorMessage,
35+
this.exception,
3636
});
3737

3838
/// The currently active tab in the content management section.
@@ -74,8 +74,8 @@ class ContentManagementState extends Equatable {
7474
/// Indicates if there are more sources to load.
7575
final bool sourcesHasMore;
7676

77-
/// Error message if an operation fails.
78-
final String? errorMessage;
77+
/// The error describing an operation failure, if any.
78+
final HtHttpException? exception;
7979

8080
/// Creates a copy of this [ContentManagementState] with updated values.
8181
ContentManagementState copyWith({
@@ -92,7 +92,7 @@ class ContentManagementState extends Equatable {
9292
List<Source>? sources,
9393
String? sourcesCursor,
9494
bool? sourcesHasMore,
95-
String? errorMessage,
95+
HtHttpException? exception,
9696
}) {
9797
return ContentManagementState(
9898
activeTab: activeTab ?? this.activeTab,
@@ -108,7 +108,7 @@ class ContentManagementState extends Equatable {
108108
sources: sources ?? this.sources,
109109
sourcesCursor: sourcesCursor ?? this.sourcesCursor,
110110
sourcesHasMore: sourcesHasMore ?? this.sourcesHasMore,
111-
errorMessage: errorMessage,
111+
exception: exception ?? this.exception,
112112
);
113113
}
114114

@@ -127,6 +127,6 @@ class ContentManagementState extends Equatable {
127127
sources,
128128
sourcesCursor,
129129
sourcesHasMore,
130-
errorMessage,
130+
exception,
131131
];
132132
}

0 commit comments

Comments
 (0)