Skip to content

Commit

Permalink
fix catch without variable name in 7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
dannyvankooten committed Jan 21, 2025
1 parent a4120fb commit d81a202
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/class-jetpack-importer.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public function start_import(): void
if ($date_end < $date_start) {
throw new Exception("End date must be after start date");
}
} catch (Exception) {
} catch (Exception $e) {
$this->redirect_with_error(admin_url('/index.php?page=koko-analytics&tab=jetpack_importer'), __('Invalid date fields', 'koko-analytics'));
exit;
}
Expand Down Expand Up @@ -251,7 +251,7 @@ public function perform_chunk_import(string $api_key, string $blog_uri, DateTime
$body = wp_remote_retrieve_body($response);
try {
$data = json_decode($body, null, 512, JSON_THROW_ON_ERROR);
} catch (Exception) {
} catch (Exception $e) {
throw new Exception(__('Received non-JSON response from WordPress.com API:', 'koko-analytics') . "\n\n" . $body);
}

Expand Down

0 comments on commit d81a202

Please sign in to comment.