Skip to content

Commit 8d69bb3

Browse files
committed
refactor(content_management): replace errorMessage with exception
- Changed `errorMessage` to `exception` in `CreateSourceState`. - Updated `exception` type to `HtHttpException`. - Improved error handling and information.
1 parent 7e5a9f5 commit 8d69bb3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/content_management/bloc/create_source/create_source_state.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ final class CreateSourceState extends Equatable {
3131
this.headquarters,
3232
this.countries = const [],
3333
this.contentStatus = ContentStatus.active,
34-
this.errorMessage,
34+
this.exception,
3535
this.createdSource,
3636
});
3737

@@ -44,7 +44,7 @@ final class CreateSourceState extends Equatable {
4444
final Country? headquarters;
4545
final List<Country> countries;
4646
final ContentStatus contentStatus;
47-
final String? errorMessage;
47+
final HtHttpException? exception;
4848
final Source? createdSource;
4949

5050
/// Returns true if the form is valid and can be submitted.
@@ -66,7 +66,7 @@ final class CreateSourceState extends Equatable {
6666
ValueGetter<Country?>? headquarters,
6767
List<Country>? countries,
6868
ContentStatus? contentStatus,
69-
String? errorMessage,
69+
HtHttpException? exception,
7070
Source? createdSource,
7171
}) {
7272
return CreateSourceState(
@@ -79,7 +79,7 @@ final class CreateSourceState extends Equatable {
7979
headquarters: headquarters != null ? headquarters() : this.headquarters,
8080
countries: countries ?? this.countries,
8181
contentStatus: contentStatus ?? this.contentStatus,
82-
errorMessage: errorMessage,
82+
exception: exception,
8383
createdSource: createdSource ?? this.createdSource,
8484
);
8585
}
@@ -95,7 +95,7 @@ final class CreateSourceState extends Equatable {
9595
headquarters,
9696
countries,
9797
contentStatus,
98-
errorMessage,
98+
exception,
9999
createdSource,
100100
];
101101
}

0 commit comments

Comments
 (0)