Better error handling in fetch data

This commit is contained in:
Vicente J. Ruiz Jurado 2018-08-14 08:55:14 +02:00
parent 1a2cdfd814
commit d3cd6012e6
3 changed files with 17 additions and 21 deletions

View file

@ -35,13 +35,6 @@ void mainCommon(List<Middleware<AppState>> otherMiddleware) {
injector.map<String>((i) => store.state.serverUrl, key: "serverUrl");
injector.map<String>((i) => store.state.gmapKey, key: "gmapKey");
/* VoidCallback mainFn = () {
loadYourLocations().then((yl) {
// Run baby run!
});
}; */
var useSentry = !globals.isDevelopment;
SentryClient _sentry;
@ -73,7 +66,8 @@ void mainCommon(List<Middleware<AppState>> otherMiddleware) {
});
}
Future<Null> _reportError(bool useSentry, SentryClient sentry, dynamic error, dynamic stackTrace) async {
Future<Null> _reportError(bool useSentry, SentryClient sentry, dynamic error,
dynamic stackTrace) async {
// Print the exception to the console
print('Caught error: $error');
if (!useSentry) {
@ -88,4 +82,3 @@ Future<Null> _reportError(bool useSentry, SentryClient sentry, dynamic error, dy
);
}
}