Skip to content

Commit

Permalink
chore: sample error
Browse files Browse the repository at this point in the history
  • Loading branch information
omartinma committed Apr 19, 2024
1 parent 94114dc commit d6c2a89
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/sample_app/bloc/sample_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ class SampleBloc extends Bloc<SampleEvent, SampleState> {
final url = Uri.https(baseUrl, endpoint);
final response = await httpClient.get(url);

if (response.statusCode != 200) {}
emit(SampleError());
if (response.statusCode != 200) {
return emit(SampleError());
}
try {
final charactersJson = jsonDecode(response.body) as Map<String, dynamic>;
final characters = (charactersJson['results'] as List)
Expand Down

0 comments on commit d6c2a89

Please sign in to comment.