Skip to content

Commit 37f75ed

Browse files
committed
fix(content_management): improve error handling in create topic page
- Replaced generic error message with more informative one. - Used `toFriendlyMessage` for better user experience.
1 parent cf2142a commit 37f75ed

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/content_management/view/create_topic_page.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import 'package:ht_dashboard/shared/constants/pagination_constants.dart';
88
import 'package:ht_dashboard/shared/shared.dart';
99
import 'package:ht_data_repository/ht_data_repository.dart';
1010
import 'package:ht_shared/ht_shared.dart';
11+
import 'package:ht_ui_kit/ht_ui_kit.dart';
1112

1213
/// {@template create_topic_page}
1314
/// A page for creating a new topic.
@@ -92,7 +93,7 @@ class _CreateTopicViewState extends State<_CreateTopicView> {
9293
..hideCurrentSnackBar()
9394
..showSnackBar(
9495
SnackBar(
95-
content: Text(state.errorMessage ?? l10n.unknownError),
96+
content: Text(state.exception!.toFriendlyMessage(context)),
9697
backgroundColor: Theme.of(context).colorScheme.error,
9798
),
9899
);

0 commit comments

Comments
 (0)