fix: prevent hard 500 on paypal sync failure path
This commit is contained in:
@@ -336,14 +336,19 @@ class AdminDashboardController extends Controller
|
||||
$resultSandbox = $sync->sync('sandbox');
|
||||
$resultLive = $sync->sync('live');
|
||||
} catch (\Throwable $e) {
|
||||
report($e);
|
||||
$this->logAdminAction('paypal_plan_sync_failed', [
|
||||
'error' => $e->getMessage(),
|
||||
]);
|
||||
try {
|
||||
$this->logAdminAction('paypal_plan_sync_failed', [
|
||||
'error' => $e->getMessage(),
|
||||
]);
|
||||
} catch (\Throwable) {
|
||||
// swallow secondary failures so sync endpoint never hard-crashes
|
||||
}
|
||||
|
||||
return back()->withErrors([
|
||||
'pricing' => 'PayPal sync failed. Check server logs for details (network/credentials/proxy).',
|
||||
]);
|
||||
return redirect()
|
||||
->route('dashboard.admin.pricing')
|
||||
->withErrors([
|
||||
'pricing' => 'PayPal sync failed. Check server logs for details (network/credentials/proxy).',
|
||||
]);
|
||||
}
|
||||
|
||||
$this->logAdminAction('paypal_plan_sync', [
|
||||
|
||||
Reference in New Issue
Block a user