Skip to content

Commit a2f2fec

Browse files
committed
refactor(sources): Remove unnecessary logging comments in source creation and editing
- Remove commented-out log statements in CreateSourceBloc and EditSourceBloc - These comments were likely intended for debugging purposes but are no longer
1 parent 4d8b049 commit a2f2fec

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

lib/content_management/bloc/create_source/create_source_bloc.dart

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ class CreateSourceBloc extends Bloc<CreateSourceEvent, CreateSourceState> {
8484
CreateSourceSavedAsDraft event,
8585
Emitter<CreateSourceState> emit,
8686
) async {
87-
// Log: Attempting to save source as draft with state: state
8887
emit(state.copyWith(status: CreateSourceStatus.submitting));
8988
try {
9089
final now = DateTime.now();
@@ -103,19 +102,17 @@ class CreateSourceBloc extends Bloc<CreateSourceEvent, CreateSourceState> {
103102
);
104103

105104
await _sourcesRepository.create(item: newSource);
106-
// Log: Successfully saved source as draft with id: newSource.id
105+
107106
emit(
108107
state.copyWith(
109108
status: CreateSourceStatus.success,
110109
createdSource: newSource,
111110
),
112111
);
113112
} on HttpException catch (e) {
114-
// Log: Failed to save source as draft. Error: e
115113
emit(state.copyWith(status: CreateSourceStatus.failure, exception: e));
116114
} catch (e) {
117115
emit(
118-
// Log: An unexpected error occurred while saving source as draft. Error: e
119116
state.copyWith(
120117
status: CreateSourceStatus.failure,
121118
exception: UnknownException('An unexpected error occurred: $e'),
@@ -129,7 +126,6 @@ class CreateSourceBloc extends Bloc<CreateSourceEvent, CreateSourceState> {
129126
CreateSourcePublished event,
130127
Emitter<CreateSourceState> emit,
131128
) async {
132-
// Log: Attempting to publish source with state: state
133129
emit(state.copyWith(status: CreateSourceStatus.submitting));
134130
try {
135131
final now = DateTime.now();
@@ -148,19 +144,17 @@ class CreateSourceBloc extends Bloc<CreateSourceEvent, CreateSourceState> {
148144
);
149145

150146
await _sourcesRepository.create(item: newSource);
151-
// Log: Successfully published source with id: newSource.id
147+
152148
emit(
153149
state.copyWith(
154150
status: CreateSourceStatus.success,
155151
createdSource: newSource,
156152
),
157153
);
158154
} on HttpException catch (e) {
159-
// Log: Failed to publish source. Error: e
160155
emit(state.copyWith(status: CreateSourceStatus.failure, exception: e));
161156
} catch (e) {
162157
emit(
163-
// Log: An unexpected error occurred while publishing source. Error: e
164158
state.copyWith(
165159
status: CreateSourceStatus.failure,
166160
exception: UnknownException('An unexpected error occurred: $e'),

lib/content_management/bloc/edit_source/edit_source_bloc.dart

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ class EditSourceBloc extends Bloc<EditSourceEvent, EditSourceState> {
142142
EditSourceSavedAsDraft event,
143143
Emitter<EditSourceState> emit,
144144
) async {
145-
// Log: Attempting to save source as draft with state: state
146145
emit(state.copyWith(status: EditSourceStatus.submitting));
147146
try {
148147
final originalSource = await _sourcesRepository.read(id: state.sourceId);
@@ -162,19 +161,17 @@ class EditSourceBloc extends Bloc<EditSourceEvent, EditSourceState> {
162161
id: state.sourceId,
163162
item: updatedSource,
164163
);
165-
// Log: Successfully saved source as draft with id: state.sourceId
164+
166165
emit(
167166
state.copyWith(
168167
status: EditSourceStatus.success,
169168
updatedSource: updatedSource,
170169
),
171170
);
172171
} on HttpException catch (e) {
173-
// Log: Failed to save source as draft. Error: e
174172
emit(state.copyWith(status: EditSourceStatus.failure, exception: e));
175173
} catch (e) {
176174
emit(
177-
// Log: An unexpected error occurred while saving source as draft. Error: e
178175
state.copyWith(
179176
status: EditSourceStatus.failure,
180177
exception: UnknownException('An unexpected error occurred: $e'),
@@ -188,7 +185,6 @@ class EditSourceBloc extends Bloc<EditSourceEvent, EditSourceState> {
188185
EditSourcePublished event,
189186
Emitter<EditSourceState> emit,
190187
) async {
191-
// Log: Attempting to publish source with state: state
192188
emit(state.copyWith(status: EditSourceStatus.submitting));
193189
try {
194190
final originalSource = await _sourcesRepository.read(id: state.sourceId);
@@ -208,19 +204,17 @@ class EditSourceBloc extends Bloc<EditSourceEvent, EditSourceState> {
208204
id: state.sourceId,
209205
item: updatedSource,
210206
);
211-
// Log: Successfully published source with id: state.sourceId
207+
212208
emit(
213209
state.copyWith(
214210
status: EditSourceStatus.success,
215211
updatedSource: updatedSource,
216212
),
217213
);
218214
} on HttpException catch (e) {
219-
// Log: Failed to publish source. Error: e
220215
emit(state.copyWith(status: EditSourceStatus.failure, exception: e));
221216
} catch (e) {
222217
emit(
223-
// Log: An unexpected error occurred while publishing source. Error: e
224218
state.copyWith(
225219
status: EditSourceStatus.failure,
226220
exception: UnknownException('An unexpected error occurred: $e'),

0 commit comments

Comments
 (0)