You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Re-throw, we only want to catch supported error codes.
42
45
throw$exception;
43
46
}
44
47
45
-
if (404 === $exception->getResponse()->getStatusCode()) {
46
-
// Try to avoid Strava rate limits.
47
-
$this->sleep->sweetDreams(10);
48
-
// Skip.
49
-
continue;
50
-
}
51
-
52
48
if (429 === $exception->getResponse()->getStatusCode()) {
53
49
// This will allow initial imports with a lot of activities to proceed the next day.
54
50
// This occurs when we exceed Strava API rate limits or throws an unexpected error.
55
51
$command->getOutput()->writeln('<error>You probably reached Strava API rate limits. You will need to import the rest of your activities tomorrow</error>');
56
52
break;
57
53
}
58
54
59
-
$command->getOutput()->writeln(sprintf('<error>Strava API threw error: %s</error>', $exception->getMessage()));
60
-
break;
55
+
if (404 !== $exception->getResponse()->getStatusCode()) {
56
+
$command->getOutput()->writeln(sprintf('<error>Strava API threw error: %s</error>', $exception->getMessage()));
57
+
break;
58
+
}
61
59
}
62
60
63
61
$stravaStreams = array_filter(
@@ -88,9 +86,6 @@ public function handle(Command $command): void
0 commit comments