Нет, потому что вы ловите в будущем.
Вы не должны кататься в будущем:
try {
final result = await http.get(pingUrl);
// .catchError((e) => print(e)); <- removed
return result;
} catch (e) {
print(e)
}
Или бросить снова в catchError:
try {
final result = await http.get(pingUrl)
.catchError((e) {
print(e);
throw foo;
});
return result;
} catch (e) {
print(e)
}
Я предпочитаю первый вариант.