Skip to content

Commit

Permalink
Improve exception for unsuccessful API call
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz-fink committed Feb 4, 2022
1 parent cce1369 commit dd54575
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/src/lotr_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,6 @@ class LotrApi {
filters.forEach((filter) {
filter?.getQueries().forEach((query) => url += '${query}&');
});
print(url);

var response = await http.get(
Uri.parse(url),
Expand All @@ -309,7 +308,8 @@ class LotrApi {
);
} else {
throw Exception('''Received error from API!
${response.statusCode} ${response.reasonPhrase}''');
${response.statusCode} ${response.reasonPhrase}
for request URL ${url}''');
}
}
}

0 comments on commit dd54575

Please sign in to comment.