diff --git a/app/app/Http/Controllers/Dashboard/AdminDashboardController.php b/app/app/Http/Controllers/Dashboard/AdminDashboardController.php index f8148fa..1dccc4d 100644 --- a/app/app/Http/Controllers/Dashboard/AdminDashboardController.php +++ b/app/app/Http/Controllers/Dashboard/AdminDashboardController.php @@ -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', [